Roger Osborn
May 21st, 1999, 06:49 AM
I have an MFC MDI server application. I want to be able to write something in VB like:
Public WithEvents anapplication As mytypelib.applicationobject
set anapplication=new mytypelib.applicationobject
To do this I changed the idl of the VC++ server to have a source interface so that the object now looks like:
coclass Applicationobject
{
[default] dispinterface IApplicationobject;
[default, source] dispinterface IApplicationobjectEvents;
};
and added connection point support to the MFC app using DECLARE_CONNECTION_MAP for the IApplicationobjectEvents interface.
However, when I attempt to run the VB it gives "430 Class does not support automation or does not support expected interface". If I take out the "withevents" it still works fine. What am I doing wrong? Is it possible to add event support like this (or at all to this type of non-ocx server)? As far as I can see the two interfaces are registered correctly as is the type library.
Thanks for any help
Roger
Public WithEvents anapplication As mytypelib.applicationobject
set anapplication=new mytypelib.applicationobject
To do this I changed the idl of the VC++ server to have a source interface so that the object now looks like:
coclass Applicationobject
{
[default] dispinterface IApplicationobject;
[default, source] dispinterface IApplicationobjectEvents;
};
and added connection point support to the MFC app using DECLARE_CONNECTION_MAP for the IApplicationobjectEvents interface.
However, when I attempt to run the VB it gives "430 Class does not support automation or does not support expected interface". If I take out the "withevents" it still works fine. What am I doing wrong? Is it possible to add event support like this (or at all to this type of non-ocx server)? As far as I can see the two interfaces are registered correctly as is the type library.
Thanks for any help
Roger