Solved

Instanciating an ActiveX control into a C program

Posted on 2000-02-29
2
647 Views
Last Modified: 2014-08-19
Hello,

I am making a C program which should use an ActiveX control.

I have an ActiveX control and i know its CLSID, I want to use it so I do :

hr = CoInitializeEx ( NULL, COINIT_MULTITHREADED );

then

hr = CoCreateInstance ( &clsid,
            NULL,
            CLSCTX_INPROC_SERVER,
            &IID_IUnknown, //(REFIID) &giid,
            &ppv );

If I do so ... I have a link error LNK2001 telling me : unresolved external symbol IID_IUnknown

When I am using an ActiveX control is it a proper manner user IID_IUnknown as the REFIID, if not what should i use as the REFIID and how do I define it.


0
Comment
Question by:mbensimo
2 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 25 total points
ID: 2570277
You'll have to link your application with 'uuid.lib' - this library holds the 'implementation' of this IID (see 'unknwn.h'). If you're using VC, adding

#pragma comment ( lib, "uuid.lib")

should do it...
0
 

Expert Comment

by:harshvir_drish
ID: 40269940
Hi,

i want to call an activex control from my dll code but when i use the interface of activex control in my dll then it says
"undeclared identifier".
i know my dll code doesn't find the declaration of interface's pointer.
can you please tell me which header files or libraries i have to include so that i can get the pointer of my activex control.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now