That's the error i'm getting when trying to use my simple dll in Dbpro. Since this is a test dll most of the code is copied from these forums.
DllMain.cpp
#include <windows.h>
#include <stdio.h>
#define EXPORT _declspec(dllexport)
#define EXPORTC extern "C++" EXPORT
#include "globstruct.h"
#include "head.h"
// ---- SUPPORT FUNCTIONS ----
GlobStruct* GetCore()
{
static GlobStruct* CorePtr = NULL;
// If already have the core pointer, return it.
if (CorePtr)
return CorePtr;
// Get the core pointer ...
typedef GlobStruct* (__cdecl *tGetGlobPtr)(void);
HINSTANCE CoreHandle = LoadLibrary("DBProCore.dll");
tGetGlobPtr GetGlobPtr = (tGetGlobPtr)GetProcAddress( CoreHandle, "?GetGlobPtr@@YAKXZ" );
FreeLibrary( CoreHandle );
CorePtr = GetGlobPtr();
// ... and return it.
return CorePtr;
}
void DeleteString(LPCSTR OldStr)
{
if (OldStr)
{
GetCore()->CreateDeleteString( (DWORD *)&OldStr, 0);
}
}
LPSTR CreateString(int Size)
{
LPSTR NewString=NULL;
GetCore()->CreateDeleteString( (DWORD *)&NewString, Size);
return NewString;
}
LPSTR CreateString(LPCSTR Source)
{
return strcpy( CreateString( (int)strlen(Source)+1 ), Source );
}
// ---- User Code ----
EXPORTC DWORD TestFunc(LPSTR OldString, int Value)
{
// Remove the old string
DeleteString( OldString );
// Allocate a new string
LPSTR RetString = CreateString(12); // 10 possible digits, leading sign, null terminator
// Populate the new string
sprintf(RetString, "%d", Value);
// Return the new string
return (DWORD)RetString;
}
RSFile.rc
#include <winresrc.h>
STRINGTABLE
BEGIN
1, "TESTFUNC[%SL%Z8TestFuncPci%"
END
Head.h
#ifndef _DLL_H_
#define _DLL_H_
# define DLLEXPORT __declspec (dllexport)
DLLEXPORT DWORD TestFunc(LPSTR OldString, int Value);
#endif /* _DLL_H_ */
Compiled dll attached.
The header file Head.h was a last second try to get it working so it may not be needed. Please take the time to reply, thanks!
Edit:
Lol, 5 minutes after I finaly post I figure it out. my problem was that I didn't completely copy the function name from the dll for the resource file. For referance when you go to copy the function name from the dll copy everything surrounding the name on both sides until you reach a space.

DBPro, limited by the programmer.