It looks basically correct. Try to explicitly specify naming convention on both sides, for example
in C++ and
I would also advice to explicitly name entry point by using
. In this way, you don't have to use
and bind the entry point even if the name is decorated or
]). To see what the actual names are, use some binary dump utility like
, which is bundled with all versions of Visual Studio; you can use it from Visual Studio Command Prompt. See http://msdn.microsoft.com/en-us/library/c1h23y6c%28v=vs.71%29.aspx
Also, I want to note that you use console in your sample DLL code but test it with Windows .NET application where the console is not shown by default. To show console, don't change anything in the project but application type. Set it to "Console Application" in the project Properties — your application will work as console and window application at the same time.