Solved

Access Violation in WSOCK32.DLL

Posted on 1998-11-23
2
305 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
Comment Utility
'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
Comment Utility
I knew it was something lame like that.

Thanks,

-- Craig
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
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 clear a vector as well as how to detect empty vectors in C++.

743 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now