E
Evgeny Smirnov
Greetings,
My program, must catch events from Visio COM server.
So I've got VB6 Standart EXE :
Dim g_Sink As CeventSamp
Dim docObj As Visio.Document
Private Sub Form_Load()
Dim eventsObj As Visio.EventList
Dim doc As Visio.Document
Dim g_appVisio
Set g_appVisio = CreateObject("Visio.Application")
Set docObj = g_appVisio.Documents.Add("")
Set g_Sink = New CeventSamp
Set eventsObj = docObj.EventList
eventsObj.AddAdvise visEvtCodeDocSave, g_Sink, "", "Document
Saved..."
eventsObj.AddAdvise visEvtCodeShapeDelete, g_Sink, "", "Shape
Deleted..."
End Sub
And VB6 ActiveX DLL:
Public Sub VisEventProc(eventCode As Integer, sourceObj As Object, eventID
As Long, seqNum As Long, subjectObj As Object, moreInfo As Variant)
Dim strDumpMsg As String
Select Case eventCode
Case visEvtCodeDocSave
strDumpMsg = "Save(" & eventCode & ")"
Case (visEvtPage + visEvtAdd)
strDumpMsg = "Page Added(" & eventCode & ")"
Case visEvtCodeShapeDelete
strDumpMsg = "Shape Deleted(" & eventCode & ")"
Case Else
strDumpMsg = "Other(" & eventCode & ")"
End Select
MsgBox strDumpMsg
End Sub
I saved a document in instant of visio(created with my programm), but didn't
see message(MsgBox strDumpMsg)...
Where am I wrong?
Thanks.
My program, must catch events from Visio COM server.
So I've got VB6 Standart EXE :
Dim g_Sink As CeventSamp
Dim docObj As Visio.Document
Private Sub Form_Load()
Dim eventsObj As Visio.EventList
Dim doc As Visio.Document
Dim g_appVisio
Set g_appVisio = CreateObject("Visio.Application")
Set docObj = g_appVisio.Documents.Add("")
Set g_Sink = New CeventSamp
Set eventsObj = docObj.EventList
eventsObj.AddAdvise visEvtCodeDocSave, g_Sink, "", "Document
Saved..."
eventsObj.AddAdvise visEvtCodeShapeDelete, g_Sink, "", "Shape
Deleted..."
End Sub
And VB6 ActiveX DLL:
Public Sub VisEventProc(eventCode As Integer, sourceObj As Object, eventID
As Long, seqNum As Long, subjectObj As Object, moreInfo As Variant)
Dim strDumpMsg As String
Select Case eventCode
Case visEvtCodeDocSave
strDumpMsg = "Save(" & eventCode & ")"
Case (visEvtPage + visEvtAdd)
strDumpMsg = "Page Added(" & eventCode & ")"
Case visEvtCodeShapeDelete
strDumpMsg = "Shape Deleted(" & eventCode & ")"
Case Else
strDumpMsg = "Other(" & eventCode & ")"
End Select
MsgBox strDumpMsg
End Sub
I saved a document in instant of visio(created with my programm), but didn't
see message(MsgBox strDumpMsg)...
Where am I wrong?
Thanks.