Visio Idle Event

A

Andy

Visio 2003

My application needs to do some processing when visio is idle. I catch
the idle event using the <object>_VisioIsIdle( ByVal app As
IVApplication) subroutine for the Visio application. However, this sub
is then continually called, using all the available CPU (aka busy
waiting). I have tried adding a WaitMessage call, but this just
returns immediately. Any suggestions?
 
A

Andy

I experimented with NoEventsPending, however this gets called when
Visio has no events to process which is not the same as Visio being
idle. I'm looking to do some processing when Visio has finished
processing. Basically my application receive events from an Excel
spreadsheet. During the processing of those events it also makes
changes to the spreadsheet which can then tigger further events. I am
trying to queue these events so i process them when all other
processing has been completed, rather than as they occur.
 
D

David Parker

Still, you need to use the NoEventsPending event combined with Enqueue.
Look at the Treeview example in the Visio SDK.
 
A

Andy

I had a look at the example, but it does not really help me. I am
already queuing up my events to be processed after Visio has finished
its processing. However I am still left with the fact that I need to
process these events when Visio is idle. This is not the same being
told When Visio has finished processing its event queue.
 
D

David Parker

I obviously cannot convince you that VisioIsIdle is the wrong event for you,
and that NoEventsPending is, because that is when Visio has finished doing
any of its automatic routing and stuff.
The only other suggestion is that you raise your own MarkerEvent ...
 
A

Andy

It's not that you can't convince me, its just I need to do my
processing when Visio has completed all its processing. If I try
NoEventsPending then my processing gets called when my application is
still doing other processing. If I was doing this with X Windows, I
would be looking to integrate my processing into the main loop. That
is why Visio is idle looked suitable, just that I can only do busy
waiting and not call a method just to wait for the next event.
 
M

Mark Nelson [MS]

Hi Andy,

It's still not clear why NoEventsPending will not work here. As David says,
you should be using NoEventsPending and not VisioIsIdle. If there is a
reentrancy issue to handle, then it would have to be handled no matter what
Visio event you work with.

--
Mark Nelson
Office Graphics - Visio
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
 
A

Andy

I have a large automated Visio application that can be responding to
either user interactions or changes that come from a spreadsheet. In
some cases the user interaction causes changes to the spreadsheet
which results in further changes coming from the spreadsheet. My aim
is to try and process these in sequence.

My ideal scenario would be to process the spreadsheet events when
visio is idle (not when there are no events pending), i.e. none of my
automation is running. However, if I do this when no events are
pending, my processing can occur during the user interaction and while
automation is running. The issue is not one of re-entrancy.

When doing this kind of thing in the past using X windows, the
solution would have been to integrate the additional processing in the
applications main processing loop. I was hoping that I coukld achieve
the same effect with Visio. I do understand that Visio idle as a
mechanism is not what i need as I just end up with busy waiting.
 
M

Mark Nelson [MS]

Perhaps you can rethink what work gets done when. When the user works in
Visio, you will get a stream of events. You queue up the processing
associated with that work until NoEventsPending (or VisioIsIdle if you
insist). When the user works in the spreadsheet, you will get another
stream of events / notifications. These can also be queued until
NoEventsPending and then processed.

I presented a developer talk at our last partner conference that outlined
this strategy of queued Visio events working alongside queued app
(non-Visio) events. Look at the session on Building a Model-driven Visio
Solution here: http://www.visioconferencecontent.com/

--
Mark Nelson
Office Graphics - Visio
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
 

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