How to prevent a COM object and its associated dialog out of scope

L

Leo

In the main dialog, I have a context menu. When I click a menu item, it
will invoke a COM object which will create a dialog (this COM object is
its wrapper).

My problem is: after the click event finishes, the COM object is out of
scope. However, I don't want this happen because I still need to play
with the new dialog and its wrapper. Any suggestion? Thanks.

Leo
 
P

Phlip

Leo said:
In the main dialog, I have a context menu. When I click a menu item, it
will invoke a COM object which will create a dialog (this COM object is
its wrapper).

You will get the best answer on a newsgroup that covers the library that
interfaces with COM. This could be the <comdef.h> stuff, or ATL, or MFC, or
several other systems.

Your post makes us guess which one you use.

This newsgroup focusses on raw C++ itself, not any of the zillions of
C++-related libraries and topics.
My problem is: after the click event finishes, the COM object is out of
scope. However, I don't want this happen because I still need to play
with the new dialog and its wrapper. Any suggestion? Thanks.

Some people who ask questions like that have built an application using the
Class Wizard, and then don't know enough about programming to then properly
featurize the resulting code. Don't be like that: Crack some books first.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,294
Messages
2,571,507
Members
48,193
Latest member
DannyRober

Latest Threads

Top