Re: Passing info between a DLL and an app
- From: "Christakis John" <noemail@xxxxxx>
- Date: Fri, 10 Mar 2006 01:13:36 GMT
aha - return >=32 for win16 and <>0 for win32
http://bdn.borland.com/article/0,1410,10322,00.html
cj
"battles" <battlesmail@xxxxxxxxxxxxxx> wrote in message
news:1141951669.259936.180450@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I am not sure if this will cure the problem. I have had bunches of
problems executing dlls in Delphi. Try executing your dll in a
procedure by itself like the one below. This seems to have cured my
dll execution problems.
procedure TForm1.LoadAndRunDLLProcedure(sDLL, sFunc : string);
type
TFunc_Start = function(pRiseSetLat, pRiseSetLong : string;
RiseSetOffset : real;
RiseOrSetSw, passmmddyyyy: string) : string;
var
Func_Start : TFunc_Start;
hDll : THandle;
FuncPtr : TFarProc;
sMsg : string;
begin
hDll := LoadLibrary( PChar( sDLL ) );
if (hDll > 32) then begin
FuncPtr := GetProcAddress( hDll, PChar( sFunc ) );
@Func_Start := FuncPtr;
if (@Func_Start <> nil) then begin
LabelRise.Caption := Func_Start(CurrencyEditN1.Text,
CurrencyEditW2.Text, -6, 'r',
FormatDateTime('mmddyyyy',
Now));
LabelSet.Caption := Func_Start(CurrencyEditN1.Text,
CurrencyEditW2.Text, -6, 's',
FormatDateTime('mmddyyyy',
Now));
end
else begin
sMsg := 'DLL entry point ' + sFunc + ' not found';
//procedure not found
MessageBox( 0, PChar( sMsg ), 'Error', MB_OK );
end;
FreeLibrary( hDll );
FuncPtr := NIL;
end
else begin
sMsg := 'File ' + sDLL +' not found';
//dll not found
MessageBox( 0, PChar( sMsg ), 'Error', MB_OK );
end;
end;
.
- References:
- Passing info between a DLL and an app
- From: Christakis John
- Re: Passing info between a DLL and an app
- From: battles
- Passing info between a DLL and an app
- Prev by Date: Re: Passing info between a DLL and an app
- Next by Date: Re: Borland selling Delphi
- Previous by thread: Re: Passing info between a DLL and an app
- Index(es):
Relevant Pages
|