Solved

Access Violation in WSOCK32.DLL

Posted on 1998-11-23
2
313 Views
Last Modified: 2011-08-18
I'm getting dozens of these trace messages in the debug frame of Microsoft Visual C++ 5.0 when I run my program:

"First-chance exception in MyShow.exe (WSOCK32.DLL): 0xC0000005: Access Violation."

What does this mean and what can I do to eliminate these exceptions from happening?

This is a very simple MFC dialog application that has two ActiveX controls, Microsoft MediaPlayer and Macromedia Shockwave Flash, both of which access winsock.  The MediaPlayer is used to play the audio track (an ASF file).  The Shockwave Flash is used to play, what else, a Shockwave Flash animation file (a SWF file).  Both of these files are streamed from the Internet.

This message starts appearing as soon as I start playing the  ASF file and continues every two to three seconds.  What is this message telling me?

Am I using the MediaPlayer ActiveX control properly?

In OnInitDialog() I do this:

    m_mpPlayer.SetAutoStart(FALSE);
    m_mpPlayer.Open("mms://netshow.microsoft.com/ms/ntserver/tech_showcase/smashing1/vanmystery2.asf");
 

Then I have a separate Play button that starts the audio playing:

    m_mpPlayer.Stop();
    m_mpPlayer.Play();

I've isolated out the Shockwave Flash player (just using the MediaPlayer) and it still happens.  I also tried setting "Access violation" to "Stop always" while debugging.  I traced it back as far as a call from the KERNEL32.

Has anyone run into this problem before?

Thanks in advance,

-- Craig
0
Comment
Question by:clance
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 50 total points
ID: 1178525
'First-chance exception in wsock32.dll...' just means that a function from within the 'wsock32.dll' caused an access-violation exception that was handled successfully inside the SEH frame that was active when the exception occurred. You can think of it being the same as if you use code like this:

long l;

__try // set up current SEH frame
{
CopyMemory ( &l, 0, sizeof ( long)); // read from 0x00000000
}
__except( EXCEPTION_EXECUTE_HANDLER) // handler for current frame
{
puts ( "We knew that this would go wrong...");
}

So let's hope that the MS programmers knew what they were doing ;-)

(Additional info: MS KB Article Q105675)
0
 

Author Comment

by:clance
ID: 1178526
I knew it was something lame like that.

Thanks,

-- Craig
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

626 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question