|
Posted by John Dinning on September 4, 2008, 11:46 pm
Please log in for more thread options
Problem solved..
I was using a Delphi 'COM Object' which has an iUnknown interface, when I
should have been using the Delphi 'Automation Object' which has an iDispatch
interface.
I was told in this newsgroup ealier that iDispatch was required (thanks) but
it took me a while to figure out how.
Anyway, I now have the basis for a custom extension in a Delphi DLL.
John.
>I am trying to write a custom extension for RMS using a COM object in a
>DLL.
> The DLL is written using Delphi, as that is what I know best, although I
> have limited experience of COM.
> As specified there is a function called Process that returns a boolean
> result.
>
> I have written a COM client in Delphi and it can call the DLL and runs the
> function ok.
>
> The function in the DLL is to be called from a Custom button on the POS.
> When I try to run the function from the Custom button it finds the DLL ok
> as it shows the 'before' and 'after' create messages in my code (see
> below) but the Store Operations POS fails to create the object or call the
> Process function.
>
> Store Operations POS always returns the error:
> "Attempt to execute COM object 'displaysomething.DisplaySomething' failed.
> Could not create object."
>
> Is there anyway of finding why it failed to create the object as this
> message is not very helpful.
>
> Any other suggestions as to what my problem might be would be very
> welcome.
>
> Regards,
> John.
>
>
> Code snippets from my DLL :
>
> function TDisplaySomething.Process(MySession: SessionClass): boolean;
> begin
> ShowMessage('Process Called!!!');
> Process := True;
> end;
>
>
>
> initialization
> ShowMessage('Before create');
>
> TComObjectFactory.Create(ComServer, TDisplaySomething,
> Class_DisplaySomething, 'DisplaySomething', 'Display Com Object',
> ciMultiInstance, tmApartment);
>
> ShowMessage('After create');
> end.
>
>
>
>
>
|