Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Access Violation in WSOCK32.DLL

Posted on 1998-11-23
2
Medium Priority
?
322 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
2 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 150 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

926 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