Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > Visual C++
|
Visual C++ Questions specific to Microsoft's Visual C++. For questions not specific to this Microsoft version, use the C++ Programming forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual C++ section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 18th, 2004, 04:45 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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
__________________
Larry Asher
 
Old February 18th, 2004, 08:59 PM
Authorized User
 
Join Date: Jun 2003
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.
 
Old February 19th, 2004, 10:22 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
 
Old March 31st, 2004, 05:41 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 453
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Ankur_Verma Send a message via MSN to Ankur_Verma
Default

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
 
Old March 31st, 2004, 08:12 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ankur,

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





Similar Threads
Thread Thread Starter Forum Replies Last Post
Connecting to an ActiveX exe Tweety77 VB How-To 4 September 19th, 2006 01:21 PM
ActiveX.exe to standard exe Kaustav VB How-To 6 February 24th, 2006 12:10 AM
Calling an ActiveX.EXE in C++ xgbnow Pro VB 6 13 February 20th, 2004 12:31 PM
unregister activeX exe gbianchi Pro VB 6 2 February 10th, 2004 03:17 PM
ActiveX Exe and Dll Vasudevan VB How-To 1 September 26th, 2003 07:48 AM





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