Problems using IDispatch with ActiveX Automation Server

We are trying to start up an ActiveX automation server using a Delphi3 program
and are experiencing some interface declaration problems. The ActiveX server
is Matlab 5.2.

The problem is that Matlab only supports an IDispatch interface, not a dual
interface. However when Delphi imports the supplied type library it trys to
create the usual dual type library with an IMLApp interface and a DIMLApp
dispinterface. The call CoMLApp.Create creates a COM Object of type DIMLApp
but then returns the exception EIntfCastError with message Interface not

If I create the COM object with CreateComObject and cast it as an IDispatch
interface then the server runs fine but I can't seem to make the invoke method
invoke any methods (not that that is really a sensible way to deal with such
an interface).

Does anyone know how I go about getting a sensible type library definition of
this interface?

Thanks in advance


PS Could any replies also be emailed to my address as the servers here in New
Zealand are somewhat random at retrieving all replies to the group


Dr. J. L. Martin
Dept. of Physics
Otago University
New Zealand