Hello all,
I'm making a very simple DLL to do a few things like return an object number that is not being used. I can't get the compiler to accept it at all. If I remove the RC file, it complains it doesn't know what parameters it takes, but when it's included it says "Parameter mismatch in command "SOME FUNCTION" at line 1. SOME FUNCTION was a previous stringtable entry.
Could Code::Blocks not be compiling the RC file? This is really driving me nuts.
.cpp file:
#define DLL_EXPORT __declspec(dllexport)
int g_curObject=0;
int g_curImage=0;
int g_curSound=0;
int g_curEffect=0;
DLL_EXPORT int getFreeObject()
{
g_curObject++;
return g_curObject;
}
DLL_EXPORT int getFreeImage()
{
g_curImage++;
return g_curImage;
}
DLL_EXPORT int getFreeSound()
{
g_curSound++;
return g_curSound;
}
DLL_EXPORT int getFreeEffect()
{
g_curEffect++;
return g_curEffect;
}
.rc file:
STRINGTABLE
BEGIN
1 "GET FREE OBJECT[%L%getFreeObject"
2 "GET FREE IMAGE[%L%getFreeImage"
3 "GET FREE SOUND[%L%getFreeSound"
4 "GET FREE EFFECT[%L%getFreeEffect"
END
// Your string table goes here.
// You must have at least ONE command for this to compile correctly.
// Here is an example:
/*
1 "STARTUP%0%StartupFunction" // void StartupFunction(void);
2 "GETVALUE[%L%GetValueFunction" // int GetValueFunction(void);
3 "GETSUM[%LLL%GetSumFunction" // int GetSumFunction(int p0, int p1);
*/
// Extra information about the string tables, for quick lookup.
/* L = Integer ( IN use "int" ) ( OUT use "int" )
F = Float ( IN use "float" ) ( OUT use "DWORD" )
S = String ( IN use "LPSTR" ) ( OUT use "DWORD" )
O = Double Float (capital o) ( IN use "double" ) ( OUT use "double" )
R = Double Integer (capital r) ( IN use "LONGLONG" ) ( OUT use "LONGLONG" )
D = Boolean, BYTE, WORD and DWORD ( IN use "DWORD" ) ( OUT use "DWORD" )
0 = Zero Character (no param) ( IN use "VOID" ) ( n/a )
H = Array ( IN use ? ) ( OUT use ? )
X = Any type ( IN use "const void*" ) ( OUT use "const void*" )
A = Special List Processing ( IN use ? ) ( OUT use ? )
* = Designate a return type */
Thanks in advance,
Jim

Yay Verizon FiOS!