Solved

Instanciating an ActiveX control into a C program

Posted on 2000-02-29
2
649 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

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
C++ vs C compilers 13 159
Finding a good hash function 4 124
smtp c source code 7 69
Test the speeds on my PC Drives 12 48
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…
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.
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.

777 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