views:

156

answers:

2

Recently I opened a .dll file produced by Visual Studio 9 while compiling a native C++ DLL project and was surprised to see the "This program cannot be run in DOS mode" text near the beginning.

Why have this text in .dll files?

+6  A: 

A dll is very much like an executable with a different extension. The text you saw is part of the 'standard' executable header on windows. It is (was) used to gracefully abort the attempt to run a windows executable from DOS.

lexu
A: 

Win32 programs run from DOS mode (ie, single user, no graphics) print that text. DLLs probably print that message too if you try to use them without Windows running.

nategoose