Quit Visio

K

kippi

Hi everone,

I control Visio through COM interface from my C++ program to change
shapes programmatically (flashing, movevement, change of color etc)
according to measured values. At the end of the runtime I release all
Visio pointers in my program and issue m_Application.Quit(); Sometimes
- not at all times - I get the massage "You cannot close Visio because
a Visio event from another program is processing..." (basically
translation - I have german Visio).
My program is waiting for the "no pending events" event from Visio.
How can I clean close Visio?

Thanks,
Kippi
 
C

Chris Roth [Visio MVP]

K

kippi

Hi Kippi,

One last bit of info:

When you set up EventSinks, you have a Visio.Event objects. You can call
.Delete on these to get rid of your references. Perhaps this will help.

--
Hope this helps,

Chris Roth
Visio MVP

Visio Guy: Smart Graphics for Visual People

  Articles:http://www.visguy.com
  Shapes:  http://www.visguy.com/shapes
  Dev:      http://www.visguy.com/category/development/
  Forum:    http://www.viguy.com/vgforum






- Zitierten Text anzeigen -

Servus Chris,

I do not use EventSinks but ConnectionPoints as did a "respectable" C+
+ programer -:):

HRESULT hr;
// Get server's IConnectionPointContainer interface.
IConnectionPointContainer *pConnPtContainer;
hr = m_appVisio.m_lpDispatch-
QueryInterface(IID_IConnectionPointContainer, (void
**)&pConnPtContainer);
ASSERT(!FAILED(hr));
// Find the connection point for events you're interested in.
hr = pConnPtContainer-
FindConnectionPoint(DIID_EApplication,&m_pConnectionPoint);
ASSERT(!FAILED(hr));
// Setup advisory connection.
hr = m_pConnectionPoint->Advise(&m_VisioEventDispatch,
&m_adviseCookie);
ASSERT(!FAILED(hr));
// Release IConnectionPointContainer interface.
pConnPtContainer->Release();

Of course you are right: I have to call
m_pConnectionPoint->Unadvise(m_adviseCookie);
and release the m_pConnectionPoint BEFORE I quit() Visio.

It seems to work perfectly! Thanks and regards,

Kippi
 

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

Top