Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Exe will not run correctly
Message
From
29/06/2005 05:09:41
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
28/06/2005 17:44:19
Calvin Smith
Wayne Reaves Computer Systems
Macon, Georgia, United States
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 7 SP1
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01027223
Message ID:
01027296
Views:
11
>The following code, when it is compiled as an exe, does not work unless the line "wait '' timeout .1" is included. I am content that I am able to get this to work but my anal coworker insists that we need to know why...
>
>_screen.windowstate=2 && max
>_screen.caption=' Get New Patriot Files'
>set sysmenu off
>_SCREEN.VISIBLE=.T.
>
>wait '' timeout .1
>
>set safety off
>set talk off
>
>ini=NEWOBJECT('writeextendini','c:\vfpcomm\myextend')
>release myarr
>dimension myarr[1]
>
>=adir(myarr,'c:\homeland\sdnfiles\*.ff')
>
>ini.retrievesdnfiles(@myarr)
> * this launches a Delphi app that compares the timestamps on certain
> * files on an ftp server. This does not run if the wait line is not included.
>IF ini.ok=.t.
> cf=JUSTPATH(SYS(2019))
> torun=ADDBS(cf)+'ftpengine.exe'
> runin=cf
> SET PROCEDURE TO runwait additive
> =launchappandwait(torun,runin)
> RELEASE PROCEDURE runwait
>endif
>
>ini=.null.
> * other stuff happens
>declare integer FindWindow in Win32api string cClass, string Cwindow
>nHwd=FindWindow(0,' Get New Patriot Files')
>if nHwd <> 0
> wParam=''
> lParam=0
> Msg=18 && quit
> DECLARE SHORT PostMessage IN user32;
> INTEGER hWnd,;
> INTEGER Msg,;
> STRING @ wParam,;
> INTEGER lParam
> PostMessage (nHwd,Msg,@wParam,lParam)
>ENDIF
>* if the wait line is not included and the _screen is not set to visible the hour glass comes up for about 5 seconds and then disappears without the delphi app running. The exe file is still running as a process but not as an application. If _screen.visible=.t. the app will start but will always show up in the task manager as not responding. Thanks for any help...

What happens if:
-you use _screen.hWnd instead of FindWindow() or
-use FindWindow with class parameter instead of caption.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform