p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Visual C++ (http://p2p.wrox.com/forumdisplay.php?f=88)
-   -   Calling an ActiveX.EXE in C++ (http://p2p.wrox.com/showthread.php?t=9523)

xgbnow February 18th, 2004 04:45 PM

Calling an ActiveX.EXE in C++
Hopefully, you all can at least point me in the right direction. I have several ActiveX exe's written in VB 6.0. Now, I am working with some legacy app's in C ++ and I want to be able to reuse that code through automation. Does anyone know how to do that or can you point me in the right direction?

Thanks in advance,

Larry Asher

Daniel_hn February 18th, 2004 08:59 PM

You can write a DLL or OCX(With event deal) in c++, then, use it in vb.I think it is more easy then in your ways.

xgbnow February 19th, 2004 10:22 AM

Well the purpose is to have the ability to reuse code that has already been written. If the code is already written in VB and can be used in C++ then that makes more sense than rewritting your application in C. Besides, my challange is not to reuse the code in another VB app it is to reuse the code in a C++ app.

Thanks anyway.

Larry Asher

Ankur_Verma March 31st, 2004 05:41 AM

See I don’t think that your ActiveX controls being EXEs make much difference to how the clients use them. If you know how to instantiate and invoke methods of any ActiveX control through a C++ application then YOU KNOW how to do that for an ActiveX exe as well. Also the basic architecture of ActiveX says that the language used to create the ActiveX control doesn’t matter either. So I don’t see how these ActiveX controls made using VB would be difficult to be used using a C++ application. I'm assuming that you know about the CoCreateInstance, QueryInterface etc. stuff. Even if you don’t, I don’t think it takes long to gain enough know how to be able to create simple COM clients in C++, the same cannot be said for COM servers, however.

Ankur Verma
.Net and C++ Specialist
Wiley Tech Support

xgbnow March 31st, 2004 08:12 AM


I would agree with you for the most part. I have done some testing and found that dll's and ActiveX exes are presented the same way within C++. It took a bit, maybe even a byte (suppose to be funny), to manipulate the string data. However, my biggest disappointment is with arrays. Due to the differences in the way VB and C++ handle\define arrays the functions that either return arrays or pass them as parameters are not recognized. This was a even more disappointing because of third party software that is designed to be used as an automation interface within languages that support automation, explicitly listing C++, has the same limitation. Now, it may be possible to pass an array but it looks like it is going to take quit a bit of work.

Thanks for you input.

Larry Asher

All times are GMT -4. The time now is 11:52 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.