Adding a COM i/f to a VB ActiveX control from a C++ tlb 
Author Message
 Adding a COM i/f to a VB ActiveX control from a C++ tlb

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.*-*-*.com/
Share what you know. Learn what you don't.



Sat, 24 Nov 2001 03:00:00 GMT  
 Adding a COM i/f to a VB ActiveX control from a C++ tlb
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

Quote:

> 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.



Sat, 24 Nov 2001 03:00:00 GMT  
 Adding a COM i/f to a VB ActiveX control from a C++ tlb
Hi Mike,

Go get the sample code for the book: 'Beginning ATL COM' from WROX at:

http://www.wrox.com/Store/Download.asp?Code=0111

This has dozens of projects complete with VB projects as sample
clients.  You will probably find an interface or two you can clone
from among these.

(You don't need to own the book to download the code)

Regards,
Kurt

Quote:

>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.



Sat, 24 Nov 2001 03:00:00 GMT  
 Adding a COM i/f to a VB ActiveX control from a C++ tlb
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



Quote:
> 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.


Sun, 25 Nov 2001 03:00:00 GMT  
 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.


Mon, 26 Nov 2001 03:00:00 GMT  
 Adding a COM i/f to a VB ActiveX control from a C++ tlb


Fri, 19 Jun 1992 00:00:00 GMT  
 Adding a COM i/f to a VB ActiveX control from a C++ tlb
Hi All.

    I am Edgar  and I trying make an applications to link external
applications for Example   Paint, Matlab or Winamp from control buttom, but
I donot do it. I need help

Tanks Veru much.



Mon, 26 Nov 2001 03:00:00 GMT  
 Adding a COM i/f to a VB ActiveX control from a C++ tlb
Edgar,

Quote:
> Hi All.

>     I am Edgar  and I trying make an applications to link external
> applications for Example   Paint, Matlab or Winamp from control buttom, but
> I donot do it. I need help

I don't quite understand what you mean by "link"... Do you, perhaps, mean Launch
(i.e. execute)? If that's so, try using ShellExecute[Ex]() or CreateProcess().

BTW: Feel free to step in the microsoft.public.es.vc newsgroup, where we can
discuss these issues in Spanish.... I'll be glad to help you there, too.

--
Tomas Restrepo

http://members.xoom.com/trestrep/



Mon, 26 Nov 2001 03:00:00 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. accessing objects in a c++ DLL from a c++ activeX control placed in a VB application

2. accessing objects in a c++ DLL from a c++ activeX control placed in a VB application

3. Adding a tlb to anther tlb

4. how to convert lib (c++) to tlb for VB

5. Passing pointers to C++ ActiveX controls in VB

6. Question: Catching errors from a VB ActiveX control in Visual C++ using MFC

7. ActiveX C++ using ActiveX VB

8. Problem using VB 5 activex DLL in a VC++ activex control

9. call a VB COM dll thru a C++ COM dll from a C program

10. call a VB COM dll thru a C++ COM dll from a C program

11. add Activex control to Activex container daynamically

12. How to add ActiveX controls to a Activex DLL

 

 
Powered by phpBB® Forum Software