Darn it, accidentally deleted my message
I was having problems with a function that returned a string and took an integer. The integer passed in was always 0
Im using this for returning strings
GlobStruct *g_pGlob;
void ReceiveCoreDataPtr( void *cdp )
{
g_pGlob = (GlobStruct *) cdp;
}
DWORD dbpstring(LPSTR pstring)
{
LPSTR pret=NULL;
DWORD dwSize=strlen((LPSTR)pstring );
g_pGlob->CreateDeleteString ( (DWORD*)&pret, dwSize+1 );
strcpy(pret, (LPSTR)pstring);
return (DWORD) pret;
}
The function was
DWORD getRoomName(int i)
{
if (i == 1)
{
return dbpstring(str1);
}
if (i == 2)
{
return dbpstring(str2);
}
return dbpstring("ERROR");
}
The stringtable entry was:
1 "GETROOMNAME[%SL%getRoomName"
And I was using this def file (I think):
LIBRARY Thingy
EXPORTS
?ReceiveCoreDataPtr@@YAXPAX@Z=_Z18ReceiveCoreDataPtrPv
setRoomName=_Z11setRoomNameiPc
the function always returned "ERROR"