regarding spawnProcess and parameters in Windows

Hugo Florentino hugo at acdam.cu
Mon Dec 16 02:15:24 PST 2013


On Mon, 16 Dec 2013 18:59:52 +0900, Mike Parker wrote:
> On 12/16/2013 6:33 PM, Hugo Florentino wrote:
>> ...
>> Why does the console window appear and how can I prevent this?
>
> This is how Windows works. There are a couple of ways to eliminate
> the console. One is to use WinMain instead of main. That requires 
> some
> boilerplate, though, as it bypasses the main function in DRuntime, so
> you have to initialize the runtime manually. It has the benefit of
> being portable across compilers. Another way, which is what I always
> do, is to add this to the command line (assuming DMD with OPTLINK):
>
> -L/SUBSYSTEM:WINDOWS:5.01
>
> Every linker on Windows has some form of this flag. It may even be
> the same when using the VC toolchain. Also, you can drop the version
> number at the end. It depends on the minimum version of Windows you
> target and the target architecture (32-bit vs. 64-bit). Google it if
> you want to be sure of the details.

That did the trick, thanks.

Now, suppose I have two versions of the application (myapp32.exe and 
myapp64.exe), and I want my launcher to launch either, based on the 
architecture it detected from the OS being run on. What could I do in 
this case, which is actually what I need to do? (I just started with the 
simpler variant)


More information about the Digitalmars-d-learn mailing list