Solved

Access Violation in WSOCK32.DLL

Posted on 1998-11-23
2
308 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 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

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Suggested Solutions

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

770 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