Solved

Closing ActiveX exe child windows

Posted on 2001-06-15
6
243 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
[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
  • 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

752 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