GetProcAddress in Delphi .net 2005



I am having difficulty making the below bit work.



If Length(fLibName) > 0 Then Begin

fLibH := LoadLibrary(LibName);

If fLibH <> 0 Then Begin

@fGetTaxName := GetProcAddress(fLibH,GetTaxNameProcName).ToPointer;

@fCalcProfit := GetProcAddress(fLibH,CalcProfitProcName).ToPointer;

End;

End;



fCalProfit : CalcProfitProc = Procedure (Cost : Currency;

CostTaxID : Integer;

Sell : Currency;

SellTaxID : Integer;

Var ProfitD : Currency;

Var ProfitP : Double); stdCall;





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...


.