It's because of the way that the garbled function names are exported with the mingw compiler. With an msvc compiler, your exported function name would look something like what you have ( ?PrintText@@YAXPAD@Z ), but with mingw the exported function would look like this: _Z9PrintTextPc
You can find out the exported function name by simply examining the dll in notepad once compiled. So basically you code your function, compile the dll, open it in notepad, change the function name in the string table to the exported garbled one, then recompile to include the correctly modified string table in the dll.
Attatched is a very simple devcpp (v4.9.9.2) project that has your PrintText function working. The only code needed is below.
Main source:
#include <windows.h>
#define DBPCMD __declspec ( dllexport )
DBPCMD void PrintText( char* strInp )
{
if (strInp)
{
MessageBox(NULL, strInp, "", MB_OK);
}
}
String table resource file:
STRINGTABLE
BEGIN
1 "PRINT TEXT%S%_Z9PrintTextPc%string to print"
END
Just copy the dll included in the archive into your 'plugins-user' folder and compile 'print text "hello" : wait key' in dbp to see it in action.
EDIT:
Not sure if the project will work with the v5 beta of devcpp, but give it a try anyway.
EDIT2:
Also see this thread for a very easy step-bystep way to create a simple dll in devcpp:
http://forum.thegamecreators.com/?m=forum_view&t=105976&b=18
Hope this helped.
Who needs a signature?