Solved

ATL ActiveX control event GPF in VB

Posted on 2000-04-03
6
276 Views
Last Modified: 2013-11-25
MSVC++ 6.0, ATL
WinNT 4.0

I'm battling a persistant problem i cannot seem to get around. I have built an ActiveX control using ATL. Using the ATL wizard I have added a connection-point to use events. When using the control in VB I have discovered that if I try to do certain things in VB in the event function I get Access violation exception. Typically this happens when I try to manipulate frames and window properties or trying to display a messagebox. It only happens when I run the built .exe, not when I run it in debug thru VB. As it is nearly impossible to do run-time debugging of VB programs (MSVBVM60.DLL = no debug info) I cannot zero in on the exact reason for the GPF. Is this a known problem? Has any one else experienced it? If you need more info as to my program, just ask. My workaround now is to use i timer-control and flags to do the operations that are not possible from the event-callbacks. This is, for apparent reasons, not an ideal sollution.
0
Comment
Question by:pellep
  • 2
  • 2
  • 2
6 Comments
 
LVL 31

Accepted Solution

by:
Zoppo earned 400 total points
ID: 2680100
Hi pellep,

Maybe you're using multiple threads?

See MSDN article 'PRB: Firing Event in Second Thread Causes IPF or GPF'
ID: Q196026

ZOPPO
0
 
LVL 8

Expert Comment

by:gelbert
ID: 2680767
Try adding trace code into your ActiveX dll to see which events were okay and which blew up
0
 
LVL 8

Expert Comment

by:gelbert
ID: 2680812
You can use "Unobtrusive COM Tracing" (http://www.develop.com/kbrown/com/samples.htm) utility to wathc what is going on
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 4

Author Comment

by:pellep
ID: 2681112
ZOPPO!!! You are a hero. I've battled with this problem for two weeks. Reading the article it all makes sence. Of course multithreading should pose problems with VB. I only assumed the universal marshaller solved that for me. I rewrote my component after the fashion described in the MSDN article and, presto, it worked.
And yes - I am using multiple threads in my component.
0
 
LVL 4

Author Comment

by:pellep
ID: 2681114
ZOPPO!!! You are a hero. I've battled with this problem for two weeks. Reading the article it all makes sence. Of course multithreading should pose problems with VB. I only assumed the universal marshaller solved that for me. I rewrote my component after the fashion described in the MSDN article and, presto, it worked.
And yes - I am using multiple threads in my component.
0
 
LVL 31

Expert Comment

by:Zoppo
ID: 2682842
happy I could help you ...

have a nice day,

ZOPPO
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

930 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

14 Experts available now in Live!

Get 1:1 Help Now