How to make Add-ons resident ?

N

NAdir

Hello,
I am developping an Add-on for Visio using .NET visual basic and want to
make its instance wainting for events. This is important for making data
persistent. So the add-on will wait for events instead of executing an
instance each time an event occur. Is there any code example ?

I appreciate your help
 
C

Chris Roth [ Visio MVP ]

Did you start with the code samples for a COM Add-in that come with the
Visio 2003 Developer's Kit? Visio loads the COM add-in, and you decide which
events you want.

Check it out:

http://www.microsoft.com/downloads/...BD-B0BB-46E7-936A-B8539898D44D&displaylang=en

Or maybe you just need to subscribe to particular events from a VB .exe? You
can use Dim WithEvents or check out AddAdvise in the Visio developer's help.

WithEvents is quite easy in VB...

Dim WithEvents pg as Visio.Page

Sub Init
Set m_pg = Visio.ActivePage
End Sub

' You get this sub for free with WithEvents...
Sub m_pg_ShapeAdded( shp as Visio.Shape )
Debug.WriteLine(shp.Text)
End Sub


--

Hope this helps,

Chris Roth
Visio MVP
 

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

Similar Threads


Top