[fpc-pascal]win and dos exes in one file

XHajT03 at mbox.vol.cz XHajT03 at mbox.vol.cz
Tue Feb 13 21:42:31 CET 2001


From:           	"Matt Emson" <memsom at interalpha.co.uk>
To:             	fpc-pascal at lists.freepascal.org
Date sent:      	Tue, 13 Feb 2001 16:17:56 GMT
Subject:        	Re: [fpc-pascal]win and dos exes in one file
Send reply to:  	fpc-pascal at deadlock.et.tudelft.nl

> >Is any way how compile win prog and dos prog in one exe ? 
> >(win exe have dos header and them win header) 
> 
> It *may* be possible (though I doubt it), it wouldn't be easy and I
> wouldn't recomend it at all. 
> 
> You'd have to write a stub that was able to pass control to the
> correct version of exe startup code.. I don't see it ever happening.

 I don't think you're quite right here. The ability to choose the 
appropriate version is in the OS already. DOS is only able to run the 
DOS (DPMI) executable, Win32 chooses the Win32 version automatically 
(but you can force it to run the DOS version as well using a switch 
of the START command), the same is true for OS/2 (a Win32 program 
running with PE2LX, or a native OS/2 executable instead), etc. 
There's another problem though, which is specific to Go32v2 programs 
(see my other e-mail in this thread); e.g. BP-compiled 16-bit 
programs can be used without any problems for this (this is no 
speculation, I know exactly what I'm talking about and have tried it 
many times, believe me).

Tomas





More information about the fpc-pascal mailing list