How to use these functions

I am developing a console and window based application in vs2010 using vc++ and according to my requirement for simplicity i would be requiring to use the "an IDEA sdk" active x functions .Can i use the active x functions in the console and window based application in vs2010(vc++). The sdk says to use the active x functions you should do the following:-

If not already registered, enter: Regsvr32 ideactls.ocx
Using the correct 32- or 64-bit version of aximp from the .NET SDK, enter: aximp ideactls.ocx
Enter: regtlib ideactls.ocx
From inside Visual Studio 2005 for the application project:

Select Project|Add Reference.
From the COM tab select idea ActiveX Control Module.
From the Browse tab, go to the ..\idea\ActiveX folder and select AxIdeaCTLSLib.dll.
I have done the first three steps .i.e till "regtlib ideactls.ocx" and was unable to do the further steps...Can anyone guide me how to do the further steps. If through these i can't use the active x functions then what should i do to use the active x functions of provided sdk.
COM is not easy to explain in a forum post. You should study COM first.

To consume an already-registered COM object you need to call CoInitialize() or CoInitializeEx(), then use CoCreateInstance() to create an instance of the object. This will give you an interface pointer. What type? The type specified in the COM object's type library. How do you get this type (and other types and CLSID's, etc.) imported into your C++ project? Simple: Use the #import directive.

Once you are done with the COM object, call Release() from the interface pointer.

Once you are done with all COM objects, call CoUninitialize().
Sir Thanks for the reply.
I know the COM is not easy to teach and learn.
But on urgent basis i have to do this as mine UNIVERSITY final year project date has came.
Can u just guide me how to use the functions in mine Win32 project.Please tell the stepd i would be very thank full to you.
Google up #import.
Google up "c++ com tutorial". The fourth result seems OK (from codeguru.com). Step 15 of the tutorial shows how to consume COM in C++; it uses the #import directive.

That should put you in the right track.
That #import directive only works in .NET projects, in C++ you only need .c and .h files generated by MIDL compiler (this must came with your idea sdk).

Then call CoInitialize(), CoCreateInstance() and further study the idea sdk documentation.

No need to worry about that ActiveX DLL location once is properly registered.
The #import directive works in unmanaged projects. It produces automatic header files from the type library.
I don't believe that #import directive has anything to do specifically with the managed/unmanaged code dichotomy modoran. Rather, I believe it was a Microsoft specific addition to either the VC5 or VC6 Microsoft C++ compiler to make working with COM components easier in C++. Unless I'm having a senior moment, brainfart, or whatever, I think that's the case.

For myself, I never liked that method of dealing with COM components, whether they be visual ones (ocxs) or not. What I would have much preferred, is if Microsoft would have taken another road entirely, and would have produced a tool to simply export decent and readable headers from the typelib. As it is, that mess produced by the #import directive, is all but unreadable and close to incomprehensible. Its my guess that few look at the code or understand it. I don't know that for a fact. Its just my guess. I do believe more C++ coders would have gotten into COM if Microsoft would have taken a different approach.
Is not messy, but sure it isn't trivial either. It is flexible. You can ask for the raw interface only or you can take advantage of the generated wrapper. Up to you.

... can ask for the raw interface only ...


I know it takes a number or parameters. Is there something then to just tell it to generate the raw interfaces, instead of all those mystery macros?
Correct. You can read the documentation @ MSDN to fine tune the behavior, like the namespace and prefix for raw methods and such. Then you'll only get a header file with type declarations matching the type library only.
Sir finally which method should i use??????????
Since I believe you previously stated you weren't very familiar with COM, and had to obtain some results as quickly as possible, your only alternative really is to follow examples you find and try to get your code to work similiarly to the examples you are using.
As stated in the article in my HKEY_CLASSES_ROOT we have to look for PROGID When i opened HKEY_CLASSES_ROOT i saw three options :-
1>IDEACTLS.IdeaBoardInfo.1
2>IDEACTLS.IdeaDisplay.1
3>IDEACTLS.IdeaFG.1

In each options there is CLSID which one should i use????
The Registry is just a registry for COM, it's where COM registers it's details. Since then the registry has grown to hold all sorts of config, but that was its original purpose.

You never look in the registry to use COM objects. You always use the API. Using COM is tricky because the implementation is partly exposed, so you have to be careful not to break it by doing the wrong thing. As a result, various attempts have been made to encapsulate it to make it easier to use. In C++, the way to use it is to use ATL.

In order to help further, we'll need to know about what you already know about COM.

Do you know what COM is?
Do you know what ATL is?
Do you have a simple ATL example (component and user) that works?
As far as your project goes, why are you using ActiveX rather than COM and do you know the difference?
Sir i am using active as the sdk has provided me the active x functions...
Topic archived. No new replies allowed.