Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > Visual C++
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 18th, 2004, 04:45 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: McPherson, Kansas, USA.
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
Reply With Quote
  #2 (permalink)  
Old February 18th, 2004, 08:59 PM
Authorized User
 
Join Date: Jun 2003
Location: , , .
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.
Reply With Quote
  #3 (permalink)  
Old February 19th, 2004, 10:22 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: McPherson, Kansas, USA.
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
Reply With Quote
  #4 (permalink)  
Old March 31st, 2004, 05:41 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , .
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
Reply With Quote
  #5 (permalink)  
Old March 31st, 2004, 08:12 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: McPherson, Kansas, USA.
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 05:24 PM.


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