vb6compilationlinkersubsystem

Compile VB6 program to Native or POSIX application?


Lately I was experimenting on my old VB6, and found there a strange thing.
Using ProcMon I found that while compiling, VB6 runs Link.exe with parameters like this:
LINK "D:\Folder\Form1.OBJ" "D:\Folder\Project1.OBJ"... /SUBSYSTEM:WINDOWS,4.0 ... I wrote Link.exe /? in cmd and found there

link.exe /?
usage: LINK [options] [files] [@commandfile]      
    options:      
    ...    
    /SUBSYSTEM:{NATIVE|WINDOWS|CONSOLE|WINDOWSCE|POSIX}

By default VB6 compiles with parameter /SUBSYSTEM:WINDOWS.
But can I compile my VB6 code to Native or POSIX subsystem application?


Solution

  • This just sets a bit in the resultung exe file. Visual Basic uses Microsoft's standard linker which is also used for C/C++, that's why the flag is there.

    So yes, you can compile it with those settings, but I'm certain that the resulting exe won't run in native mode or in the Posix subsystem.

    For more information on those settings you might want to check out information about the PE file format and have a look at the DUMPBIN and EDITBIN tools.