Re: GetProcAddress in Delphi .net 2005
- From: "Andre Joosten" <andrejoosten@xxxxxxxxxxx>
- Date: Fri, 29 Apr 2005 09:54:59 +1200
Marc,
The basic problem is the requirement to allow for Multiple tax calculation
options.
So the have an object that works out Tax under differnt circomstances, now
based on what you want you load a taxDll. This will override some (or all)
of the calculations.
So you pre-define a number of procedures you expect in the taxdll.
Some Dlls have only a few, some have all.
In the end the user can select (Buy) a paritcular taxdll.
I used the meganism before (Before .net). Works well.
I now use the VLI option, works well, just have an interface for each
Calculation.
So for a new TaxLib name you get somthing like..
If Supports(fLibName, TypeOf(ICalcProfit), fCalcProfit) Then
Else fCalcProfit := Nil;
And further down..
Procedure TTaxLib.CalcProfit (Cost : Currency;
CostTaxID : Integer;
Sell : Currency;
SellTaxID : Integer;
Var ProfitD : Currency;
Var ProfitP : Double);
Begin
If Assigned(fCalcProfit) Then Begin
fCalcProfit.CalcProfit(Cost,CostTaxID,Sell,SellTaxID,ProfitD,ProfitP)
End Else Begin
ProfitD := Sell - Cost;
.........
By the way the name is Dutch, so is 'Niew Zeeland'
"Marc Rohloff" <marcrohloff_ng@xxxxxxxxxxx> wrote in message
news:1114695085.150679.231990@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>
> Andre Joosten wrote:
>> 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...
>
> Can't you convert the libraries to .NET assemblies or alternatively to
> COM objects? What sort of security settings do you need to run under.
> Are you ever going to load more than one DLL in a session? Is the name
> of the DLL and the exported function always the same?
> I know of 3 ways to do this, they all have their pros and cons.
>
> Generally this technique is typically called Dynamic PInvoke. A search
> should get you a few hits. This is the first:
> http://www.msnewsgroups.net/group/microsoft.public.dotnet.languages.csharp/topic740.aspx
>
> 'Joosten'? This isn't a typical NZ name is it?
>
> --
> Marc Rohloff
>
.
- 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
- Re: GetProcAddress in Delphi .net 2005
- From: Andre Joosten
- Re: GetProcAddress in Delphi .net 2005
- From: Marc Rohloff
- GetProcAddress in Delphi .net 2005
- Prev by Date: Re: Virtual Library Interfaces (VLI).
- Next by Date: Newbie Needs Help
- Previous by thread: Re: GetProcAddress in Delphi .net 2005
- Next by thread: Virtual Library Interfaces (VLI).
- Index(es):
Relevant Pages
|