How to shut down a VB COM server called from VC++ client

What is the proper way to shut down a VB server (and associated forms) from a VC++ client?  

We are writing a VC++ application that is started and monitors/commands hardware, collects/stores data and does some number-crunching.  We are also writing a VB HMI (an ActiveX EXE) that is created (when the user desires a UI) from the VC++ client using the CoCreateInstance command above.  So our VC++ engine is a COM client and our VB HMI is a COM Server.  They communicate through events and properties we've set up on the VB/HMI/Server side, and an event sink on the VC++/Engine/Client side.

In brief:

VB 6.0=GUI=out-of-process COM Server / ActiveX EXE (instantiated by engine)
VC++=engine=standard MFC project and COM client (instantiates the GUI when needed)

Basically we are using the standard interface class module that is created when you use the new app wizard and select "ActiveX EXE", and that creates/loads a few GUI forms that accept user input.  When the interface class terminates (per request by the engine), I have code that closes all those GUI forms and sets the pointers to nothing.

Unfortunately the GUI EXE remains in the process list after this is done.  I can't seem to find the right sequence to kill my GUI dead.

So, what is the proper way to shut down a VB server (and associated forms) from a VC++ client?  Is there something special we have to do from the VC++/client side?  We are relatively new at COM.

(High point value because it is a specific/deep question, and I have a feeling we're going to require a little education plus some code snippets.  Thanks in advance.)
riceman0Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jkrCommented:
>>I have code that closes all those GUI forms and sets the pointers to nothing.
>>Unfortunately the GUI EXE remains in the process list after this is done

Why don't you call 'ExitProcess()' or (it's VB equivalent) in the server at this point?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
GlomCommented:
Hi,

Have you tried to send it a windows message to tell your VB App to shutdown ?

Like
PostMessage(yourVBWindowHandle, WM_QUIT, 0L, 0L);
0
GlomCommented:
Tip : You can use FindWindow(..) to retreive your Window Handle
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C++

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.