Re: GetProcAddress in Delphi .net 2005



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: version of an assembly
    ... Object reference not set to an instance of an object for line 101 and F is ... It seems that that dll is loaded from temporary asp.net files, ... the timestamp is newer but it is not my newest building timestamp. ... Does that mean it loads the old assembly from so called cache, ...
    (microsoft.public.vsnet.general)
  • Re: How can use LONGLONG type of C++ Dll in Declare Function stateme
    ... the VB datatype Currency instead of LongLong, ... Surely, there must be cleaner ways of implementing support for LongLong, ... I want to use a function in the dll on Excel VBA. ... Private Declare Function GetDiskSpaceLeft lib 'xx.dll' (ByVal dwID as ...
    (microsoft.public.excel.programming)
  • 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)
  • 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)