Im no expert with C and need some help/advice on how to wrap a Pascal DLL with C.
I have a legacy Pascal application that has no parameters to pass and is basically;
Compiling this produces a DLL that I can easily call from within another Pascal program. However, how do I call this DLL within C?
I have tried;
But having tried all manner of variations on this I never get anything that will fully compile since I always get a "Not within target frame" error.
What am I doing wrong?
I have a legacy Pascal application that has no parameters to pass and is basically;
Code:
Library MyLib;
PROCEDURE MyProcedure; export;
BEGIN
....
END.
exports MyProcedure;
BEGIN
...
END.
Compiling this produces a DLL that I can easily call from within another Pascal program. However, how do I call this DLL within C?
I have tried;
Code:
#include "stdio.h";
extern "C" PASCAL MyProcedure;
int main(int argc, char* argv[])
{
MyProcedure;
return 0;
}
But having tried all manner of variations on this I never get anything that will fully compile since I always get a "Not within target frame" error.
What am I doing wrong?