Add reference withing an vc++ ActiveX Control

G

Guest

I am creating an ActiveX control that should contain a reference to a certain
COM interface.
I have written before a C# application containing this COM interface but my
problem is that it seems not to be possible to add a reference to my COM
interface within my vc++ ActiveX controller.
Perhaps Im missing some fundemental understanding about ActiveX controllers.

So I guess my question is. Is it possible to add a reference to a COM
interface within an ActiveX controller?
 
C

Carl Daniel [VC++ MVP]

OfurGørn said:
I am creating an ActiveX control that should contain a reference to a
certain COM interface.
I have written before a C# application containing this COM interface
but my problem is that it seems not to be possible to add a reference
to my COM interface within my vc++ ActiveX controller.
Perhaps Im missing some fundemental understanding about ActiveX
controllers.

So I guess my question is. Is it possible to add a reference to a COM
interface within an ActiveX controller?

Project references, such as you're used to in C#, don't exist in unmanaged
C++. Instead, to make use of a COM component, you'll typically #import the
type library (.TLB or .OCX) file directly in your C++ code (you can do this
in you "precompiled header file", usually known as stdafx.h as well). If
you don't have a type library, then typically you'll have either an IDL file
or a C-header file (.H file) that you can include in your project to expose
the type and constant defitions for the COM object to your C/C++ code.

-cd
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top