Trouble with Creating an Event Object that Sends a Notification

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.
 

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