NoEventsPending

R

Rasmus A

I am listning to the events in my COM add-in for visio, but the event dont
stops firing.. isnt it only supposed to fire when the event que is empty ?
 
J

JuneTheSecond

Generally, in normal conditions, there could not happen.
Would you tell us more details to help us studding?
 
R

Rasmus A

Hey
1. I have made the add in as a Shared add-in in Visual Studio
2. I have written the code in the autogeneratet class Connect.vb
3. other events i listen for is the QueueMarkerEvent, wich i have used
because my buttons are added in the visio dokument
visioApplication is the variable i have assignet withEvents
'Private Sub object_NoEventsPending(ByVal app As Application)
Handles _ visioApplication.NoEventsPending
' MyActionHere()
'End Sub
Hope this helps.

Rasmus A
 
J

JuneTheSecond

R

Rasmus A

I dont really understand the example, this is my first plugin to visio. But
after looking at the example i decided to go with the event filter demo in
the visio 2003 sdk, but there i have run into another problem,
The code i the demo for adding an event looks like this
' Add an event for all ShapeAdded events
pageEventList.AddAdvise(visEvtAdd + _
CShort(Microsoft.Office.Interop.Visio.VisEventCodes. _
visEvtShape), _
eventHandler, "", noFiltersSet)
And then i hoped i could write


pageEventList.AddAdvise(CShort(Microsoft.Office.Interop.Visio.VisEventCodes.visEvtNonePending), _
eventHandler, "", noFiltersSet)
but when i run the code i get


An exception occurred.
at Microsoft.Office.Interop.Visio.EventListClass.AddAdvise(Int16
EventCode, Object SinkIUnkOrIDisp, String IIDSink, String TargetArgs)
 
J

JuneTheSecond

I don't understand, either. I think there might be more easy way.
For example a proper if-then-else may skip the proccessing due to
mouse-move-events .

In module named ThisDocument.
Option Explicit
Dim WithEvents appObj As Visio.Application
Dim WithEvents shp As Visio.Shape
Dim isMouseMove As Boolean

Private Sub appObj_MouseMove(ByVal Button As Long, ByVal KeyButtonState As
Long, ByVal x As Double, ByVal y As Double, CancelDefault As Boolean)
isMouseMove = True
End Sub

Private Sub appObj_NoEventsPending(ByVal app As IVApplication)
If isMouseMove Then
' Do nothing
Else
Debug.Print app.Name; " appObj_NoEventsPending"
End If
isMouseMove = False
End Sub

Private Sub Document_DocumentOpened(ByVal doc As IVDocument)
Set appObj = Application
Set shp = ActivePage.Shapes(1)
End Sub

Private Sub Document_DocumentSaved(ByVal doc As IVDocument)
Set appObj = Application
Set shp = ActivePage.Shapes(1)
End Sub

Private Sub shp_CellChanged(ByVal Cell As IVCell)
Debug.Print Cell.Name; " changed!"
End Sub
 
R

Rasmus A

I would also like som more dokumentation about eventhandling i visio. But i
have made i work with the eventSink class.

visioApplication.EventList.AddAdvise(&H1200, _
eventHandler, "", "")

i looked it op and &H1200 was the value i needed :)
Thanks for helping me
 
J

JuneTheSecond

Now, I 've got anew book and find the Events Table that has the item
equivalent to the event codes. This book is "Visio2003 Developer's Survival
Pack" written by Graham Wideman. The atable would be found at page 504. I
also made a excel table after very tiresome test, however there are still
many vacant area in my table, but I hope my table will have something new.
The table could be downloaded at:
http://60.43.141.155/visiosquare/cgi-bin/upload/image/144.zip
 

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