How to force Visio to create window for ActiveX control

M

mach

I have a ActiveX control with a button, the control is created with MFC with
default setting, I found that when I insert the control to a Visio draw, the
m_hWnd is NULL and the button can not work, how do I handle this?
 
C

Chris Roth [ Visio MVP ]

Visio has a "run mode", kind of linked to the VBA engine that's behind
Visio. So if you are out of run-mode, controls don't work. (Look for the
little cyan-blue triangle on the Developer tool bar)

I tried making a master shape out of a command button once. When I dropped
the master onto the page, Visio went out of run mode. (into design mode) The
developers told me this was "correct", but I forget the whole story.

I'm not sure if an external Visio add-on can get Visio back into Run Mode
after it exits...

Not a complete answer, but perhaps some clues to follow.

--

Hope this helps,

Chris Roth
Visio MVP
 
M

Mark Nelson [MS]

You're correct, Chris. Visio automatically drops into design mode when an
ActiveX control is placed on the page. Unfortunately, this causes add-ons
to suspend until Visio enters run mode again. The problem is that the user
is the only one that can do this. The add-on can't do it because it is
suspended and has no idea that Visio is in design mode. Not a good
situation.

--
Mark Nelson
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
 
C

Chris Roth [ Visio MVP ]

But does design-mode suspend ONLY VBA or all automation interaction?

It wasn't clear in my post, but I thought perhaps an external add-on/code
would not be affected by the Design Mode Doldrums.

--

Hope this helps,

Chris Roth
Visio MVP
 
M

Mark Nelson [MS]

My understanding is that all add-ons are affected by Design Mode.

--
Mark Nelson
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
 

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