Re: Ok noobies, DoEvents is slow!!! Here's are faster methods:
Hi nathanriddle66,
Welcome to VBForums. :) This post is really in the wrong place though. It's a question, so it doesn't belong in the CodeBank area. Furthermore, it's probably more of a VBA question than a VB6 question (which is the area you're in). Although, I'm quite sure the VB6 folks can answer it.
I'm going to ask the moderators to move it. So, if you see it moved, that's why.
Now, it's been quite a few years since I've used the VBA with PowerPoint. However, I use it with Excel and Word rather frequently. Furthermore, I Automate Excel and Word from VB6 on a regular basis. From that experience, my thought is that you're taking the wrong approach with all of this. And there's also a mis-understanding about what DoEvents actually does (but I'll address that lastly).
Rather than use DoEvents to updating shapes and/or their positions, I'd find the appropriate PowerPoint object to refresh, and use the Refresh method on that object. From a quick search of the PowerPoint VBA help, it seems that the Refresh method is primarily used on charts, but that may be precisely what you need. It's clearly available on other objects as well though.
Using the Refresh method, you will do precisely what you're trying to do, rather than just generally attempting to tell PowerPoint to do all underlying business.
Now, DoEvents doesn't "exactly" track mouse movements. What DoEvents does is to suspend your code (wherever it is), and then tell the application (PowerPoint in this case) to execute whatever events are immediately in the queue. And, when that's done, processing is returned to your code that was suspended. So, I suppose if you have some MouseMove events in the queue, in a sense, it may be tracking mouse movements. But, in general, it's not.
Also, just as a note, DoEvents is specific to your application (again, PowerPoint in this case). Some people get it confused with the Sleep API function, but Sleep does something very different from DoEvents.
Maybe that'll help. Best Of Luck,
Elroy
Re: Alternative to DoEvents