MsgRun() - strange problem

MsgRun() - strange problem

Postby Jeff Barnes » Wed Feb 22, 2006 3:43 pm

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
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Postby James Bott » Wed Feb 22, 2006 4:21 pm

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
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Jeff Barnes » Wed Feb 22, 2006 4:50 pm

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
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Postby James Bott » Wed Feb 22, 2006 5:13 pm

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
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Jeff Barnes » Wed Feb 22, 2006 5:24 pm

Thanks James.

Using cGetFile instead of cGetFile32 solved the problem.

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 88 guests