Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
DLL entry point function cannot be managed; compile to native
DllMain cannot be compiled to MSIL; it must be compiled to native.
To resolve,
Compile the file that contains the entry point without /clr.
Put the entry point in a #pragma unmanaged section.
For more information, see
Example
The following sample generates LNK1306.
// LNK1306.cpp
// compile with: /clr /link /dll /entry:NewDllMain
// LNK1306 error expected
#include <windows.h>
int __stdcall NewDllMain( HINSTANCE h, ULONG ulReason, PVOID pvReserved ) {
return 1;
}