there is a well-known book for programming windows, called "Programming Windows" from Microsoft Press by Charles Petzold. it's 4" thick, has a number of useful examples, though I think there could be plethora and more complicated, and the examples are not compiler-specific so you will have to try to figure out how to get it to compile. it took me some time, because some microsoft functions and definitions/declarations/prototypes have changed. it requires digging ionto the MSDN to see what is the latest API, because the book is dated. I have one example piece of windows PE code at http://sf.net/projects/randline
I think you will find that only Java (as far as popular current languages I know of) has the capability of compiling to byte-code that can run on any platform-specific JVM - ah, but there's the rub -
you have to install the JVM to run the code. this is why Java apps are unpopular now.
C++, like most compilers, generates executables/binaries which are platform-specific. not only that, in windows there are not 1, but *3* types of binary executables (plus whatever file program-to-associations made available using shellapi in the registry). .com, .exe, windows PE .exe
windows PE exe cannot run on dos.
console mode exe cannot run on dos and I think it can't run on windows 9x/me.
however, if you are creating a Windows GUI program, this CAN run on WINE, which is available on linux and DarWINE on Mac. don't know about solaris, aix, hpux, and other flavors of *NIX.
My best understanding is that WINE does not contain a cmd shell emulator, nor does it contains NTVDM nor command.com for running .com programs. this means it cannot emulate windows completely for ALL programs, just most. some
installers, like some of mine, and Symantec Ghost, use cmd shells to run batch files that do various things to setup the system. the uninstaller might too.
linux does have a DOS emulator (EMX or DOSEMU or something) which can run .com programs (but note that .com programs MUST use int13h for disk, int21h functions for accessing dos, int10h for video, etc, so it's back to the DOS world for programming).
I have had to test some things under linux to see if they would work.
fortunately, Notepad++ works on linux! it's just a pain when it auto-updates (but you can turn that off).
only think I don't like about notepad++ is it's handling of end of line (not cr's and lf''s). I don't like the way it wraps. I want never-ending lines. maybe I will submit a feature request.
I just found a function for parsing command-line arguments:
GetCommandLine(), which can be UNICODE16.
CommandLineToArgvW(), which generates
GlobalFree() when you are done with the list.
#include shellapi.h and winbase.h
-lshellapi -lkernel32 for link options
maybe someone will teach me the #defines and #ifdefs and API's of linux so I can get started writing better platform-independent code.
for instance, does linux have any 64-bit ftell() and fseek(), or is its fseek and ftell simply defined as 64-bit already?
> From: Werner LEMBERG <wl@...>
>Sent: Thursday, February 2, 2012 9:40 PM
>Subject: Re: [Mingw-users] Precendence of COM and EXE
>>> Uh, oh. Please forgive the ignorance of a poor GNU/Linux guy who
>>> has never programmed within MS Windows.
>> You've no need to beg forgiveness here, Werner. We've been
>> communicating via the groff list long enough to recognise each
>> other's strengths, and weaknesses. I know MSW is a new departure
>> for you; indeed, I was somewhat surprised by your move to this dark
>Well, I have to... An application which I've written with the Qt
>framework should work with Macs, Windows boxes, and GNU/Linux.
>Everything was quite fine except the single-binary issue I was trying
>to solve (and which I've failed, as you all know now :-)
>Try before you buy = See our experts in action!
>The most comprehensive online learning library for Microsoft
>is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
>Metro Style Apps, more. Free future releases when you subscribe now!
>MinGW-users mailing list
>This list observes the Etiquette found at
>We ask that you be polite and do the same. Disregard for the list etiquette may cause your account to be moderated.
>You may change your MinGW Account Options or unsubscribe at: