Windows programming

Moderators: None (Apply to moderate this forum)
Number of threads: 3711
Number of posts: 9173

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
ActiveX, DLLs, VB, and VC++ - Oh, my!! Posted by KirkD on 21 Jan 2002 at 12:28 PM
I'm in the very early stages of a project and need some guidance regarding VC++ and VB mixing. Essentially, I have a number of computation engines which I want to package as DLLs which will be called from VB. I would most like to write the DLLs in VC++. They will be used to due intensive compuations but won't be responsible for any graphical output.

My question(s):

What are the requirements to develop components in VC++ such that VB can call them?

What about classes? Can I have class objects passed to and from VB into/out of the DLLs? (Class objects would most appropriately contain my data.)

What variable types are compatible between the two languages employed in this manner?

Are there any really good books out there which show you how to do these things? Most of the books I've seen deal with strictly visual components rather than computation engines such as these.

Any help is appreciated.


Report
Re: ActiveX, DLLs, VB, and VC++ - Oh, my!! Posted by AsmGuru62 on 22 Jan 2002 at 7:40 AM
VB was created to work with COM objects and ActiveX controls. ActiveX is built on top of COM. In VC++ you create:
1. An ActiveX if you need GUI in some place.
2. COM object if you need some 'silent' object: database transactions, calculation engine, etc.

When you done you use VB script to create an instance of the object and call its methods and work with its properties:

strPath As String;
MyEngine As CalcEngine; 'That is your COM made with VC++


CalcEngine.Property1 = 17
CalcEngine.Property2 = 4
n = CalcEngine.Modulo

------------------------------------------
something like that.

Next step for you will be creating a simple COM (there is a Wizard in VC++, so you do not need to type huge pile of code) and hooking it up to VB. The best source is MSDN for this task - look up the articles - in usual help you can't find much... search for something like: "COM objects in VB" or something close. If you did not find a lot at this point search for articles about COM, but then you will have to scan a HUGE pile of material, so it will take more time for you to learn what you need...

Good luck!
Cheers!


Report
Re: ActiveX, DLLs, VB, and VC++ - Oh, my!! Posted by KirkD on 22 Jan 2002 at 8:02 AM
Guru,

Thank you!! That clarifies a lot. Hmmm...it appears I have some reading to do, eh?




: VB was created to work with COM objects and ActiveX controls. ActiveX is built on top of COM. In VC++ you create:
: 1. An ActiveX if you need GUI in some place.
: 2. COM object if you need some 'silent' object: database transactions, calculation engine, etc.
:
: When you done you use VB script to create an instance of the object and call its methods and work with its properties:
:
: strPath As String;
: MyEngine As CalcEngine; 'That is your COM made with VC++
:
:
: CalcEngine.Property1 = 17
: CalcEngine.Property2 = 4
: n = CalcEngine.Modulo
:
: ------------------------------------------
: something like that.
:
: Next step for you will be creating a simple COM (there is a Wizard in VC++, so you do not need to type huge pile of code) and hooking it up to VB. The best source is MSDN for this task - look up the articles - in usual help you can't find much... search for something like: "COM objects in VB" or something close. If you did not find a lot at this point search for articles about COM, but then you will have to scan a HUGE pile of material, so it will take more time for you to learn what you need...
:
: Good luck!
: Cheers!
:
:
:

Report
Re: ActiveX, DLLs, VB, and VC++ - Oh, my!! Posted by AsmGuru62 on 22 Jan 2002 at 8:32 AM
I was doing exactly that couple of years back - let me dig up my docs which explains how to make it work (if I can) and I'll send something to you...



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.