Re: GetProcAddress in Delphi .net 2005
- From: "Andre Joosten" <andrejoosten@xxxxxxxxxxx>
- Date: Thu, 28 Apr 2005 10:52:28 +1200
I did find you can't use getprocaddress direct.. need to use a delegate
But i can not find (much) on how to do that...
"Jamie" <jamie_5_not_valid_after_5_Please@xxxxxxxxxxx> wrote in message
news:2rUbe.25417$c42.953@xxxxxxxxxxx
> Andre Joosten wrote:
>> I have a couple of Tax modules (Dll) . so i made an object that loads the
>> correct dll.
>> The Dll's are ok, i can link them stasticaly. eg This works :
>>
>>
>> Procedure CalcProfit (Cost : Currency;
>> CostTaxID : Integer;
>> Sell : Currency;
>> SellTaxID : Integer;
>> Var ProfitD : Currency;
>> Var ProfitP : Double); External 'STAX.DLL';
>>
>>
>>
>> But when I try Dynamicaly, It loads the Dll, and finds the ProcAddress,
>> but i get an error when trying to use the address. I also checked in the
>> dll, it never gets there, so its not (just) parameter handeling.
>>
>> All the documentation indicates that it should work...
>>
>>
>> "Marc Rohloff" <marcrohloff_ng@xxxxxxxxxxx> wrote in message
>> news:1114607167.255048.239710@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>>
>>>Andre Joosten wrote:
>>>
>>>>I am having difficulty making the below bit work.
>>>> fLibH := LoadLibrary(LibName);
>>>> @fGetTaxName :=
>>>
>>>GetProcAddress(fLibH,GetTaxNameProcName).ToPointer;
>>>
>>>>It 'sorta' works, but I can not use the fGetTaxName or fCalcProfit
>>>>Without a error :
>>>>"Object reference not set to an instance of an object"
>>>
>>>>What am i doing wrong...
>>>
>>>The problem is that .NET does not really work this way. Sometimes you
>>>need to do things differently in .NET.
>>>
>>>So what are you trying to do, exactly?
>>>
>>>--
>>>Marc Rohloff
>>>
>
> var
> CalcProfit:Procedure ( what ever params..)
>
> -- some where in code land ---;
>
> CalcProfit := GetProcAddress(DllHandle, 'TheRealNameOfExport');
>
> --
> you most likely would have less problems using real win32 code.
>
> must be some ugly bouncing around going on in .Net
>
.
- Follow-Ups:
- Re: GetProcAddress in Delphi .net 2005
- From: Marc Rohloff
- Re: GetProcAddress in Delphi .net 2005
- References:
- GetProcAddress in Delphi .net 2005
- From: Andre Joosten
- Re: GetProcAddress in Delphi .net 2005
- From: Marc Rohloff
- Re: GetProcAddress in Delphi .net 2005
- From: Andre Joosten
- Re: GetProcAddress in Delphi .net 2005
- From: Jamie
- GetProcAddress in Delphi .net 2005
- Prev by Date: Re: GetProcAddress in Delphi .net 2005
- Next by Date: Re: GetProcAddress in Delphi .net 2005
- Previous by thread: Re: GetProcAddress in Delphi .net 2005
- Next by thread: Re: GetProcAddress in Delphi .net 2005
- Index(es):
Relevant Pages
|