I think either we need an export table OR u need to compile with Mingw and that stupid .def file..
I don't think it'll work with codeblocks because codeblocks overwrites the .def file upon compiling and after a little reading, it seems u need it ={
AND since it's pascal types the compiler should have something called #PASCAL defined as __attribute(declspec) or something like that..
Also since it's being exported to pascal, I just read that u MUST provide the Symbolic/Mangled Name for the functions instead.. so.. cdecl or __stdcall should remove the _ from the symbolic name.. OR it could be a __fastcall? can't remember
Code:
DLL_EXPORT int __stdcall GetFunctionInfo(int x, void*& address, char*& def)
{
switch(x)
{
case 0:
address = (void*)GetProcAddress(hinstance, "_AddC@0"); //Cast to (Void*) Where it says _AddC@0 must be the symbolic name.. Found in the .def I think
strcpy(def ,"procedure AddC(I: Integer);"); //This is how pascal will call the function..
return x;
}
return -1;
}