JoostWJ
asked on
Delphi DLL for C++ program
Hi,
I'm new at writing a DLL in Delphi. I have no experience with C++. I want to write one for a program in C++. This program requires me to implement some functions in the DLL to return info to the program.
The author of the program has given an example to do this in C++, it looks like
const char* doYourThing() {
return "1.00";
}
But what must I write in my Delphi DLL to return "1.00" to the C++ program???
I've tried
library checkmail;
uses
ShareMem,SysUtils,Classes;
{$R *.res}
function doYourThing(): string; cdecl;
begin
Result := PChar('1.00');
end;
exports
doYourThing;
begin
end.
but then i get a memory error.
Hope someone can help....
Greetinx,
Joost
I'm new at writing a DLL in Delphi. I have no experience with C++. I want to write one for a program in C++. This program requires me to implement some functions in the DLL to return info to the program.
The author of the program has given an example to do this in C++, it looks like
const char* doYourThing() {
return "1.00";
}
But what must I write in my Delphi DLL to return "1.00" to the C++ program???
I've tried
library checkmail;
uses
ShareMem,SysUtils,Classes;
{$R *.res}
function doYourThing(): string; cdecl;
begin
Result := PChar('1.00');
end;
exports
doYourThing;
begin
end.
but then i get a memory error.
Hope someone can help....
Greetinx,
Joost
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This old question needs to be finalized -- accept an answer, split points, or get a refund. For information on your options, please click here-> http:/help/closing.jsp#1
EXPERTS:
Post your closing recommendations! No comment means you don't care.