1. RE: J.Nickerson: DosBox: path bug??
I assume pCurrentDir = acquire_mem(memset3, "C:\\" )
is the current dir?
Mine is
pCurrentDir = acquire_mem(memset3, "C:\\tweaks\\blat\\" )
but the active dir when pCommand runs is the current dir of dosbox2.exw
(c:\euphoria\euapps\euemail\)
not a big problem, just caused confusion because the dos box was hidden
=) and could not see any errors. Just have to make sure everything is
pointed instead of assuming current dir is the current dir
jjnick at cvn.com wrote:
> Just need to add the following lines after acquiring memory for the
> startup info structure . . .
>
> store(ptStartup, dwFlags, STARTF_USESHOWWINDOW)
> store(ptStartup, wShowWindow, SW_HIDE)
>
> Don't forget to define STARTF_USESHOWWINDOW . . .
>
> Here is the rest of the code:
>
> -- This routine will call a DOS console, suspend euphoria window (code),
> -- then revert back to the window once the DOS console is done.
> --
> -- Of course, euphoria's system() does the same thing, but does not
> -- work in Windows 2000: the euphoria program continues running even
> -- if the DOS console is still running. Calling system_exec() works
> -- under 2000 but the console is not released when finished.
> --
> -- Please Note: the "/c" switch in the call to "command.com" will exit
> -- the DOS console when finished.
> --
> -- Have to use the API CreateProcess() because it is the only function
> -- that works with WaitForSingleObject(), given the context of the
> -- requirement outlined above.
> --
> -- Jason Nickerson
>
> include win32lib.ew
> without warning
>
> global constant TRUE = 1,
> FALSE = 0,
> NORMAL_PRIORITY_CLASS = 32,
> INFINITE = -1,
> STARTF_USESHOWWINDOW = 1
>
>
> global constant
> cb = allot( DWord ),
> lpReserved = allot( Ptr ),
> lpDesktop = allot( Ptr ),
> lpTitle = allot( Ptr ),
> dwX = allot( DWord ),
> dwY = allot( DWord ),
> dwXSize = allot( DWord ),
> dwYSize = allot( DWord ),
> dwXCountChars = allot( DWord ),
> dwYCountChars = allot( DWord ),
> dwFillAttribute = allot( DWord ),
> dwFlags = allot( DWord ),
> wShowWindow = allot( Word ),
> cbReserved2 = allot( Word ),
> lpReserved2 = allot( Ptr ),
> hStdInput = allot( Hndl ),
> hStdOutput = allot( Hndl ),
> hStdError = allot( Hndl ),
> SIZEOF_STARTUPINFO = allotted_size()
>
> global constant
> hProcess = allot( Hndl ),
<snip>
Grape Vine
13728824
2. RE: J.Nickerson: DosBox: path bug??
Ah, i see. My mistake =)
jjnick at cvn.com wrote:
> Well, in other words, pCurrentDir is where you decide to launch your DOS
> program, not where you initially run your program from . . .
>
> For example, in my application, I use a variable to keep track of where
> the
> application was run from so that it knows where my DOS program is, using
> Euphoria's current_dir(). If I don't do this, then a user opening or
> saving
> a file changes the "current working directory".
>
> Here is the documentation from the API CreateProcess():
>
> lpCurrentDirectory
>
> Points to a null-terminated string that specifies the current drive and
> directory for the child process. The string must be a full path and
> filename
> that includes a drive letter. If this parameter is NULL, the new process
> is
> created with the same current drive and directory as the calling
> process.
> This option is provided primarily for shells that need to start an
> application and specify its initial drive and working directory.
>
> ----- Original Message -----
> From: "Grape Vine" <g__vine at hotmail.com>
> To: "EUforum" <EUforum at topica.com>
> Sent: Monday, June 11, 2001 9:32 AM
> Subject: RE: J.Nickerson: DosBox: path bug??
>
>
> >
> >
> > I assume pCurrentDir = acquire_mem(memset3, "C:\\" )
> > is the current dir?
> > Mine is
> > pCurrentDir = acquire_mem(memset3, "C:\\tweaks\\blat\\" )
> > but the active dir when pCommand runs is the current dir of dosbox2.exw
> > (c:\euphoria\euapps\euemail\)
> > not a big problem, just caused confusion because the dos box was hidden
> > =) and could not see any errors. Just have to make sure everything is
> > pointed instead of assuming current dir is the current dir
> >
> >
> > jjnick at cvn.com wrote:
> > > Just need to add the following lines after acquiring memory for the
> > > startup info structure . . .
> > >
> > > store(ptStartup, dwFlags, STARTF_USESHOWWINDOW)
> > > store(ptStartup, wShowWindow, SW_HIDE)
> > >
> > > Don't forget to define STARTF_USESHOWWINDOW . . .
> > >
> > Grape Vine
> > 13728824
> >
>
>
Grape Vine
13728824