Does anyone have any experience of creating a DLL written in Delphi to be called from a custom button?
I have written a simple DLL containing a COM object that I can call successfully from a Delphi client, but cannot get it to run from a Custom button.
When debugging, it calls the TTypedComObjectFactory.Create line (so it finds the DLL ok and it is registered) but I get the error: "ActiveX component can't create object."
The code looks like this:
unit RMSTestDLL;
{$WARN SYMBOL_PLATFORM OFF}
interface
uses Windows, ActiveX, Classes, ComObj, RMSTestDLL_TLB, StdVcl, QSRules_TLB;
type TRMSTestDLL = class(TTypedComObject, IRMSTestDLL) protected {Declare IRMSTestDLL methods here} function Process(var RMSSession: SessionClass):boolean; end;
implementation
uses ComServ, Dialogs;
function TRMSTestDLL.Process():boolean; begin ShowMessage('Ok'); Process := True; end;
initialization TTypedComObjectFactory.Create(ComServer, TRMSTestDLL, Class_RMSTestDLL, ciMultiInstance, tmApartment); end.
Any suggestions very welcome.
Regards,
John