Solved

Instanciating an ActiveX control into a C program

Posted on 2000-02-29
2
651 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.

739 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