Solved

ATL ActiveX control event GPF in VB

Posted on 2000-04-03
6
273 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 30

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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
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 30

Expert Comment

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

have a nice day,

ZOPPO
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
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 viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
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.

747 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

12 Experts available now in Live!

Get 1:1 Help Now