> It's possible to convert a method into a standalone procedure at run
> time so the DLL could call it with all the right parameters in the
> expected places, but it's a bit of work, so it's best avoided.

It may be beneficial in my case.  The DLL definately only supports 
standard procedures and functions.  There is no user-data parameter.

I'm currently duplicating several class variables as global variables to 
get around the problem.

Is there a way to do the reverse of what you mentioned and have access 
to object variables from a standard procedure outside the object?  This 
would also solve the problem if it is possible.  I thought I may be able 
to do this:
(global)
var oMyObject: TMyObject;

constructor TMyObject.Create;
begin
  inherited Create(AOwner);
  oMyObject := Self;
end

The only problem I see with this, is that the same component can be put 
onto a form multiple times, so oMyObject will only refer to the last one 
created.

In fact, I just realized the global function and procedure pointers will 
also be overridden by the last DLL loaded in any one of the components. 
This is getting messy.  This is why I was hoping I could use functions 
within an object since the pointers are duplicated everytime a new 
object is created.

I suppose I could have an "array of procedure" and "array of function" 
and an array of TMyObject and each object instance created would assign 
a sequential number as the array subscript and use this to access the 
DLL pointers etc.  Sound feesible?

Regards,
Ross. 


_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to