mebarron
asked on
Delphi DLL called from Delphi and then from C
The DLL has two entry points
Func1 and Func2. Delphi Exe calls
Func1 which opens a file and writes to it, it works.
I want to call Func2 from C and append to the
same file.
I have :
Procedure func2(Param: PChar): PChar; stdcall;
external ;
export
func1 index 1,
func2 index 2;
From C do I just do:
int func2(char*);
....
nRet = func2("Hi Mom!");
Any tips? What statement goes in the C code
to reference the DLL - here by number;
Many Thanks , Mark
Func1 and Func2. Delphi Exe calls
Func1 which opens a file and writes to it, it works.
I want to call Func2 from C and append to the
same file.
I have :
Procedure func2(Param: PChar): PChar; stdcall;
external ;
export
func1 index 1,
func2 index 2;
From C do I just do:
int func2(char*);
....
nRet = func2("Hi Mom!");
Any tips? What statement goes in the C code
to reference the DLL - here by number;
Many Thanks , Mark
ASKER
I do not understand your first sentence.How
do I statically generate a .lib file?
do I statically generate a .lib file?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
many thanks
Also your C declaration needs a declspec(dllimport) to force the stdcall calling convention.