Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

Linker Tools Error LNK1306

Error Message

DLL entry point function cannot be managed; compile to native

Beginning in Visual C++ 2005, DllMain cannot be compiled to MSIL; it must be compiled to native.

To resolve,


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;
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2014 Microsoft. All rights reserved.