Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Access Violation in WSOCK32.DLL

Posted on 1998-11-23
2
Medium Priority
?
315 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 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
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 use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

722 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