Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Jerky Animated Giff While Processing
Message
 
À
24/09/2008 07:38:54
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01350136
Message ID:
01350266
Vues:
32
>Simply that. Due to the processing that is going on, the animated gif looks jerky, stopping and starting. Is there any way to have it run smooth while Foxpro is working?

Since VFP doesn't support multithreading, this is one of those places were things just aren't a nice as you'd like them to be. What I've done in the past is to create a form in a VCX (that is, as a class). Then I added the animated GIF (or whatever) to the form and a method I can call which updates some text on the form so I can display some information about what is being processed. I hide the title bar (TitleBar = 0). Then I marked the class as OLEPUBLIC (with the form open click on Class on the menu, then Class Info). Check the "OLE Public" box.

In the code that displays the processing window I changed it to call this as a COM object instead of a normal class, that is, I did this:
* Create a property on the current form called oForm
* It is going to hold a reference to the COM object to make
* sure it doesn't go out of scope.

* Replace "NameOfMyProject" with the name of your project
* Replace "NameOfMyClass" with the name of the form class you created.
ThisForm.oForm = CREATEOBJECT("NameOfMyProject.NameOfMyClass")
ThisForm.oForm.SetStatus("Status Message")
ThisForm.oForm.Show()
Now when you do this, since it's now a COM object, it will start another instance of the app so the animation will be smooth. The downside to this is that you need to make sure you register the COM object as part of your app installation, ex. from a DOS prompt:
NameOfMyExe.exe /regserver
That registers the COM accessible types for you. You actually don't have to do this on your dev. machine since it happens automatically when you build.
-Paul

RCS Solutions, Inc.
Blog
Twitter
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform