MsgRun() - strange problem

Post Reply
User avatar
Jeff Barnes
Posts: 912
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada
Contact:

MsgRun() - strange problem

Post by Jeff Barnes »

Hi Everybody,

I have a strange problem with MsgRun().
I use MsgRun to call a function that opens a file selection dialog.
After I select the file, the file selection dialog closes but for some reason I
need to put my mouse in the "Please Wait..." dialog before my program will continue or I need to press a key on the keyboard.

MsgRun("Please Wait ... Reading CD","Please Wait", {|| ReadCD() })
(ReadCD() function is below)


Any ideas as to what I am doing wrong?

Thanks,

Jeff

Function ReadCD()
Private cNewFile, nLen, nError, cFile, cFileDir
if lFirstRun
cFileDir := cGetFile32("Cascade Data Files |*.smd|"+ ;
"Easy II Video Data Files |*.eas|" + ;
"Sierra Wave Data Files |*.sd|" ;
,"Select a file to Review")
lFirstRun := .f.
cExt := upper( RIGHT( cFileDir, 3 ) )
else
if cExt = "SMD"
cFileDir := cGetFile32("Cascade Data Files |*.smd|"+ ;
"Easy II Video Data Files |*.eas|" + ;
"Sierra Wave Data Files |*.sd|" ;
,"Select a file to Review")
cExt := upper( RIGHT( cFileDir, 3 ) )
elseif cExt = "EAS"
cFileDir := cGetFile32("Easy II Video Data Files |*.eas|" + ;
"Sierra Wave Data Files |*.sd|"+;
"Cascade Data Files |*.smd|" ;
,"Select a file to Review")
cExt := upper( RIGHT( cFileDir, 3 ) )
else
cFileDir := cGetFile32("Sierra Wave Data Files |*.sd|"+ ;
"Easy II Video Data Files |*.eas|" + ;
"Cascade Data Files |*.smd|" ;
,"Select a file to Review")
cExt := upper( RIGHT( cFileDir, 3 ) )
endif
endif
nLen:= Len(alltrim(cFileDir))
cFile = Right(cFileDir, nLen-3)
MsgRun("Please Wait ... Extracting Files From CD","Please Wait", {|| CopyWave() })
Return nil
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

Jeff,

It might be a problem because you are calling a new msgWait() from one already running. Try adding a sysrefresh() at the end of the codeblock.

James
User avatar
Jeff Barnes
Posts: 912
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada
Contact:

Post by Jeff Barnes »

James,

After a bit of testing, it looks like the problem is with cGetFile32.

I used MsgWait("Test", "Test" , 2) both before and after the cGetFile32.

When it is before, I get my test message.
When it is after, I do not see the test message until I either put my mouse in the "Please Wait" dialog or press a key.

I have also removed the other MsgRun() when I ran this test.

Jeff
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

Jeff,

Try a sysrefresh() after cGetFile32(). Also, I think you can call cGetFile() when using a 32bit compiler (and still get the 32bit control).

James
User avatar
Jeff Barnes
Posts: 912
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada
Contact:

Post by Jeff Barnes »

Thanks James.

Using cGetFile instead of cGetFile32 solved the problem.

Jeff
Post Reply