A
andrewLLL
H
I am using Visio 2003 activeX control for my VB project. I have trouble creating Shape Connection events using AddAdvise method. Following the tutorial in Visio website, the code is
in my VB class named clsVisEventSink
Implements Visio.IVisEventPro
Private Function IVisEventProc_VisEventProc(
ByVal nEventCode As Integer,
ByVal pSourceObj As Object,
ByVal nEventID As Long,
ByVal nEventSeqNum As Long,
ByVal pSubjectObj As Object,
ByVal vMoreInfo As Variant) As Varian
Dim strMessage As Strin
' Determine if mouse up event fired
If nEventCode = visEvtAdd + visEvtConnect The
'call my procedur
End I
End Functio
To add this event, using this method in my VB form
Private Sub CreateCustomEventList(
Dim eventsObj As Visio.EventLis
Dim eventObj As Visio.Even
Dim g_Sink As clsVisEventSin
'Get the EventList collection of this document
Set eventsObj = myControl.Window.EventLis
Set g_Sink = New clsVisEventSin
'Add Event objects that will send notifications
'Add an Event object for the add connection event
Set eventObj = eventsObj.AddAdvise(visEvtAdd + visEvtConnect, g_Sink, "", "Connection Added..."
End Su
This routine gave an automation error. Anybody knows why and how to make it work? Thanks
Andrew
I am using Visio 2003 activeX control for my VB project. I have trouble creating Shape Connection events using AddAdvise method. Following the tutorial in Visio website, the code is
in my VB class named clsVisEventSink
Implements Visio.IVisEventPro
Private Function IVisEventProc_VisEventProc(
ByVal nEventCode As Integer,
ByVal pSourceObj As Object,
ByVal nEventID As Long,
ByVal nEventSeqNum As Long,
ByVal pSubjectObj As Object,
ByVal vMoreInfo As Variant) As Varian
Dim strMessage As Strin
' Determine if mouse up event fired
If nEventCode = visEvtAdd + visEvtConnect The
'call my procedur
End I
End Functio
To add this event, using this method in my VB form
Private Sub CreateCustomEventList(
Dim eventsObj As Visio.EventLis
Dim eventObj As Visio.Even
Dim g_Sink As clsVisEventSin
'Get the EventList collection of this document
Set eventsObj = myControl.Window.EventLis
Set g_Sink = New clsVisEventSin
'Add Event objects that will send notifications
'Add an Event object for the add connection event
Set eventObj = eventsObj.AddAdvise(visEvtAdd + visEvtConnect, g_Sink, "", "Connection Added..."
End Su
This routine gave an automation error. Anybody knows why and how to make it work? Thanks
Andrew