Re: GetProcAddress in Delphi .net 2005



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
>


.



Relevant Pages

  • Re: Execution detail of Asp.net
    ... page in another temp dir. ... then loads them. ... > compiles the page to a dll in a temp dir, and loads the page (again a ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: GetProcAddress in Delphi .net 2005
    ... > I did find you can't use getprocaddress direct.. ... Are you ever going to load more than one DLL in a session? ... Generally this technique is typically called Dynamic PInvoke. ...
    (alt.comp.lang.borland-delphi)
  • understanding files
    ... I have some questions about some exe, dll, and other ... It's called upon from the registry key ... what do these execuables do and are they necessary? ... \config.nt loads it ...
    (microsoft.public.windowsxp.general)
  • Re: ok ... so...
    ... when you first hit an asp.net site, loads a new appdomain, then loads the ... asp.net dll for that page. ... > I have about 5 user controls which build up the page. ...
    (microsoft.public.dotnet.framework.aspnet)
  • seLinux: how do I avoid this error
    ... I am writing an application for fedora cora 5 that loads a DLL. ... seLinux is enabled, I get the following error from the attempt to load ...
    (comp.os.linux.development.apps)