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

x
?
Solved

Using ActiveX(wirtten in VB) in C++

Posted on 1999-07-11
8
Medium Priority
?
204 Views
Last Modified: 2010-04-02
I designed ActiveX Control in VB (Connection Control based on standard Winsock Control)
I have no problem using it in VB application,

I inserted this control to C++ Application ( Microsoft C++ 6.0 )

When I run this program I got :
First-chance exception in test3.exe (KERNEL32.DLL): 0xC0000005: Access Violation.
(In Control Constructor)

I Commented UserControl_Initialize() in VB.

But I still have this exception.
(Maybe this is because of base-code but I changed it and I got the same effect )

Help Please.

Michael.

0
Comment
Question by:msoft
[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
  • 5
  • 3
8 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 1199719
'First-chance exception in kernel32.dll...' just means that a function from within the 'kernel32.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...");
}


(Additional info: MS KB Article Q105675)

The article can be found at http://support.microsoft.com/support/kb/articles/q105/6/75.asp 

A first chance exception is called so as it is passed to a debugger before the application 'sees' it. This is done by sending a 'EXCEPTION_DEBUG_EVENT' to the debugger, which can now decide whether it is passed to the apllication to handle it or 'ignore' it (e.g. like an 'EXCEPTION_BREAKPOINT' aka 'int 3')

If the exception isn't handled, it becomes a '2nd chance' exception, the debugger 'sees' it the 2nd time and will usually terminate the program (without using a debugger, these exceptions end up at 'UnhandledExceptionFilter()' which will also signal the exception to the user with one of these 'nice' message boxes and terminate the program, also...)

BTW: 'first chance' exceptions are only displayed when running a debugger - you can safely ignore them...
 
0
 

Author Comment

by:msoft
ID: 1199720
Hi JKR.

The Problem is that after those exceptions the ActiveX dosen`t work propertly.
And there is no reason to get those Exceptions.

Sorry but I have to Reject your answer.

Michael.
0
 
LVL 86

Expert Comment

by:jkr
ID: 1199721
A 'First Chance' exception definitely won't affect the behaviour of the control - are you encountering other errors?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:msoft
ID: 1199722
Yes, I do have one more problem.

The properties that I set in Design mode are not being saved.
( When I run the programm The Properties are Empty ).


0
 
LVL 86

Expert Comment

by:jkr
ID: 1199723
Hmm, this sounds more like the source of your problem (and could also be the source of this exception from which the program recovers properly)
0
 
LVL 86

Expert Comment

by:jkr
ID: 1199724
Hmm, I think that at least regarding the source of the 'first chance exception', my answer was correct - you didn't mention any properties...
0
 

Author Comment

by:msoft
ID: 1199725
jkr,
Yes seems like your aswer was correct...

Please Answer this question again so I could accept it.

Michael.
0
 
LVL 86

Accepted Solution

by:
jkr earned 800 total points
ID: 1199726
Thanx!!!
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
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.
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.

715 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