
Adding a COM i/f to a VB ActiveX control from a C++ tlb
I was able to return an error status by doing the following:
Err.Clear
Err.Raise eNum
where eNum is a long variable containg the error number to be return as
an HRESULT to the calling C++ program.
--
---tnx, mike
Quote:
> OK. I got the COM interface added by doing the Implements in the User
> Control itself rather than adding a Class and doing the Implements
from
> the Class.
> Now, the COM interface methods generated in the User Control are
> Private Subs but I need to return an HRESULT (a integer value). I
tried
> changing the Sub to a Function, but evidently the Private Subs are
> wrappers for the real public COM interfaces. Any ideas on how to
return
> a value from a Sub?
> --
> ---tnx, mike
> > Open up the component described by the TYPE library in OLEVIEW(part
of
> > Visual Studion/C++) and look at it. I should have the interface you
> are
> > interested in. Is it the default interface?
> > Dennis
> > > I need to add a COM interface to a VB5 ActiveX user control. The
COM
> > > interface is pre-defined in a C++ .tlb type library and is based
on
> > > IDispatch.
> > > I tried adding a class to my VB ActiveX control and using
> "Implements
> > > Foo" where "Foo" is known via a Reference to "Foo.tlb" but Foo
> doesn't
> > > show up as a COM interface in VC++ OLE/COM Object Viewer.
> > > --
> > > ---tnx, mike
> > > Sent via Deja.com http://www.deja.com/
> > > Share what you know. Learn what you don't.
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.