2006/5/4, Alexandre Leclerc <[EMAIL PROTECTED]>:
Now, I have to build a GUI based app inside a DLL with FPC 2.0.2 since
I can't link with the DLL build with latest version -- this is just
not working at all.
I can't do this, this is not working, as L505 told me.
I tried to bypass my compiler version problem by compiling a dll with
fpc 2.1.1 and then create another dll with fpc 2.0.2. This sounded
like a pretty stupid yet working patch to me. Well, this is not
working.
If any one here has any idea of what is going on... :) let me know. :)
The follogin dll is working:
////
library iftls;
{$mode objfpc}{$H+}
uses
md5;
function MakeMD5Hash(ASource: PChar; ADestination: PChar): LongInt; stdcall;
var
s: string;
sSize: LongInt;
begin
s := MD5Print(MD5String(ASource));
sSize := Length(s) + 1;
Move(PChar(s)^, ADestination^, sSize);
Result := sSize;
end;
exports
MakeMD5Hash;
end.
////
Calling MakeMD5Hash from the above compiled dll will work. Calling the
same function from the following dll will fail:
////
library iftls;
{$mode objfpc}{$H+}
uses
md5;
function MakeMD5Hash(ASource: PChar; ADestination: PChar): LongInt; stdcall;
var
s: string;
sSize: LongInt;
begin
s := MD5Print(MD5String(ASource));
sSize := Length(s) + 1;
Move(PChar(s)^, ADestination^, sSize);
Result := sSize;
end;
function ConfigureProduct(ASource: PChar; ADestination: PChar):
LongInt; stdcall; external 'project1.dll';
exports
MakeMD5Hash,
ConfigureProduct;
end.
//// The following dll will always fail calling any function: ////
library prdconf;
{$mode objfpc}{$H+}
function ConfigureProduct(ASource: PChar; ADestination: PChar):
LongInt; stdcall; external 'project1.dll';
function ConfigureProductA(ASource: PChar; ADestination: PChar):
LongInt; stdcall;
begin
Result := ConfigureProduct(ASource, ADestination);
end;
exports
ConfigureProduct, ConfigureProductA, MakeMD5Hash;
end.
--
Alexandre Leclerc
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives