Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Form Controls go blank during processing
Message
From
24/06/2008 11:03:39
 
 
To
24/06/2008 09:34:14
Charlie Schreiner
Myers and Stauffer Consulting
Topeka, Kansas, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP1
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01326002
Message ID:
01326374
Views:
18
Hi Charlie, long time no see.

Sergey is a genius (no doubt) so I must be doing something wrong on my end but not sure what. I have a main form that kicks off the process to download several 500K row tables that get attached directly to Excel's pivotcache object. That all works great but the entire process to load, save, zip and FTP takes in excess of 35 minutes.

Based on feedback I created a seperate modeless form that only contains a grid displaying how many rows in each table and a check mark is assigned to a column when a process completes. Unfortunately, if I switch to another application (such as IE) then come back to my VFP app, the form is all gray - not even an outline of the grid can be shown.

I added the following code to the modeless forms LOAD event:

#DEFINE WM_ACTIVATE 0x0006
BINDEVENT( _VFP.hWnd, WM_ACTIVATE, This, "refreshstatus" )

The UNLOAD event contains code to release the BINDEVENT as follows:
#DEFINE WM_ACTIVATE 0x0006
UNBINDEVENTS( _VFP.hWnd,WM_ACTIVATE )

Here is what is contained in my custom REFRESHSTATUS() method:

WAIT WINDOW NOWAIT "Hey, the refreshstatus method was just called at " + TRANSFORM( DATETIME() )
ThisForm.Draw()

I just removed some of the tables (so it runs in 3 minutes) for testing and the REFRESHSTATUS() method never fired but I did experience a blank status form (no visible grid). However, I can assure you it is there at the beginning.

I also tried to add DOEVENTS before the process to download the data but once that kicks in I guess I am just waiting for it to finish. '

Bottom line - I am still trying to work out a solution...

>Hi Tom,
>Did Sergey's solution work? I suppose it's heresy to wonder. :-)
>I would have thought you should separate the download part from the part that shows the progress.
>Creating a OLE public class and senting messages to it from the download part I would think should work well.
>This.oStatus = NEWOBJECT("frmStatusOLE", "frmStatusOLE.VCX")
>This.oStatus.WhatGoingOn("First Thing Facts Contained In An Object")
>
>
>>I have a very intensive 30+ minutes process that downloads five large tables (a few over 500K rows) via ADO then drops them into Excel's pivotcache object. In order to reveal the status to the end user, I created a form that contains a grid that is used to show the status such that task 1 (download table 1) is complete.
>>
>>I am running the process now and when I switched to another app (such as the UT) and come back to my program the form appears but it is all blank. I can no longer see the grid that is attached to the form at all.
>>
>>I suppose I need to call a form refresh or paint but how can I do that when all the processing cycles are involved in an intensive process? Can I do something like a click event on the form to refresh itself or will that be ignored when the program is running since all resrouces are assigned to the table download? Is there a way around this sitution? If not, all my work to create a form with a grid to show the status is probably a waste of time...
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform