Solved

ATL ActiveX control event GPF in VB

Posted on 2000-04-03
6
282 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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
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.

808 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