Solved

ATL ActiveX control event GPF in VB

Posted on 2000-04-03
6
286 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
[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
  • 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
Industry Leaders: 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!

 
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Post a good COM tutorial 1 72
VS2015 Redefinition errors 4 103
Embarcadero C++ builder XE10.1 Berlin TRegistry declaration 1 59
COM server issue 2 25
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…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

734 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