Ross Levis wrote: >> 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.
OK. You'll need to tell me the signature for the function, as the DLL expects it (the standalone procedure). Something like this: function DLLCallbackFunction(param1: PAnsiChar; param2: Integer): LongBool; stdcall; > 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? The object could simply keep its own pointers to those procedures as fields. No need to introduce global arrays. As it is, the code I'm going to give you will require the same thing. You'll call a function, which will take a method pointer from the object and return a regular procedure pointer, which the DLL can call. Each instance of your class will need to call my function-generating function, and when an object gets freed, it will need to call a corresponding function-destroying function. -- Rob _______________________________________________ Delphi mailing list -> [email protected] http://www.elists.org/mailman/listinfo/delphi

