Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All,
I have a ActiveX(COM) components. It can be used the visual studio Win forms by using "Choose Items" options. My client wants to refer in a Win 32 C++ application . How can I refer my ActiveX to the Win32 C++ application?


Please help me to solve this...
Thanks
Antoni
Posted
Comments
[no name] 15-Apr-14 12:42pm    
http://www.codeproject.com/Articles/633/Introduction-to-COM-What-It-Is-and-How-to-Use-It
Sergey Alexandrovich Kryukov 15-Apr-14 12:58pm    
This is a bit too wide. The problem is — why? Please see my comment below and my answer.
—SA
Sergey Alexandrovich Kryukov 15-Apr-14 12:57pm    
What ActiveX components? controls or what? And why you need them in a console application?
—SA
P.Gnanaraj 15-Apr-14 14:03pm    
Thanks for the interest shown.Basically the ActiveX is a tool kit to develop OPC servers. This customer he wants his server to be Win32 c++ application...
Sergey Alexandrovich Kryukov 15-Apr-14 14:36pm    
Thank you. Anyway, I answered your question. You need to use the techniques explained in the referenced MSDN article.
Will you accept the answer formally (green "Accept" button)?
—SA

1 solution

Please start here: http://msdn.microsoft.com/en-us/library/wbds43cy.aspx[^].

It all depends on what are those ActiveX components are. The issue is "controls", because your application in a console application. "Controls" actually means windowed controls, but the techniques described in the article also covers any non-control (not-visual) ActiveX components. So, if they are not windowed controls, it's all clear.

How about controls? Quick answer is: a console application have no controls, so ActiveX controls cannot be used. But, strictly speaking, you can use then, because "console application" may simply mean that you build your project as a console application. It does not mean you cannot have some windowed UI in your application, it simply means that it has some automatically created default console shown. So, in addition to a console window you can create some windows application which will work in parallel to your console, so you can use ActiveX controls in it.

Let me note that combination of a console with windowed UI would be pretty unusual, even though it's easy. Many would even consider it ugly. I covered this case only to address ActiveX controls. As your question was merely "how can I refer", I already answered in the first paragraph.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900