Solved

Closing ActiveX exe child windows

Posted on 2001-06-15
6
236 Views
Last Modified: 2012-05-04
Hi,

I am working on an application which opens up a bunch of activeX exe forms which are set to be children of the calling form. What I need to do is to find a way to cleanly shut all of these down.

Zaphod.
0
Comment
Question by:Z_Beeblebrox
  • 3
  • 2
6 Comments
 
LVL 3

Expert Comment

by:rmichels
ID: 6196424
Why not create a method in the activeX EXE that tells it to shut a particular form down, or all forms.

Then the application making use of the activeX exe can call that method to close the form(s).
0
 
LVL 6

Expert Comment

by:JonFish85
ID: 6196434
see what you can get from this idea:

Dim frm As Form

For Each frm In Forms
  Unload frm
  Set frm = Nothing
Next frm
0
 
LVL 7

Author Comment

by:Z_Beeblebrox
ID: 6196749
JonFish85:

That doesn't work for ActiveX exe windows.

rmichels:

That was the original plan, however we discovered that if the user end-tasked the activeX exe, then the main app tried to call the close method, the main app crashed and even doing an on error goto didn't help. As a result, we would like to find an alternative.

Zaphod.
0
Technology Partners: 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 3

Accepted Solution

by:
rmichels earned 50 total points
ID: 6197595
Hmmm

I'm not sure what you can do about an end-user killing the activeX exe.  The main app crashed because it's underlying client went away.

I have written a similar thing.  In my company's application we have a desktop toolbar that is basically a C++ dialog box.  There is an ActiveX exe that is used to start and track running GUI objects (called object proxy).  These GUI objects are also activeX exes. When the toolbar shuts down it tells the object proxy to shutdown all running forms.  I have an on error condition to handle GUI objects that have exited abnormally.  That has worked for me.

I suspect something in COM is tossing an error that you can't trap?  What sort of error is display on the main object when the user kills the activeX exe?
0
 
LVL 7

Author Comment

by:Z_Beeblebrox
ID: 6198759
Hi,

I will do some investigation when I'm at work on Monday.

Zaphod.
0
 
LVL 7

Author Comment

by:Z_Beeblebrox
ID: 6212312
Sorry it took so long to get around to this. I tested it and trapping the error seems to work fine. Something wierd must have been happening on that computer that day.

Zaphod.
0

Featured Post

Independent Software Vendors: 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!

Question has a verified solution.

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

Suggested Solutions

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

763 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