472,952 Members | 2,482 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,952 software developers and data experts.

How to make a DLL in C++ an duse it in Visual Basic 6?

Hi Everybody!

I need to develop some functions in C++.NET DLL and share it to Visual
Basic 6.0, which is the best path to create a C++ DLL an then use that
function later...?

I appreciate some help.

Thank you
Carlos Villaseñor M.

Jul 11 '06 #1
2 1109
Option 1: export a function normally and use the declare statement in VB6
Option 2: Write a COM object (e. g. in ATL) and add a reference to the TLB
in your VB6 project

For the first one, the C++ lib is easier to implement and the VB6 client is
more difficult to implement. If you go for the other option it is just the
opposite.

Marcus
"Carlos Villaseñor M." <cv*******@avantel.netwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
Hi Everybody!

I need to develop some functions in C++.NET DLL and share it to Visual
Basic 6.0, which is the best path to create a C++ DLL an then use that
function later...?

I appreciate some help.

Thank you
Carlos Villaseñor M.

Jul 11 '06 #2
"Carlos Villaseñor M." <cv*******@avantel.netwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
I need to develop some functions in C++.NET DLL and share it to Visual
Basic 6.0, which is the best path to create a C++ DLL an then use that
function later...?
You don't say whether this DLL contains native or managed code. If the code
is managed (i.e. it targets the .Net platform) then the DLLs you make with
VS are assemblies whcih contain classes. Those classes can appear to be COM
objects to the likes of VB if you "register" the assembly.

This link descrribes the registration tool, regasm:

http://msdn.microsoft.com/library/de...lRegasmexe.asp

If the code in the DLL is native, I'd suggest you build a COM object because
COM was invented for VB (GD&R). To that end you could use ATL to take some
of the sting out of COM development. This page may help to get you started:

http://www.codeproject.com/atl/com_atl.asp

Regards,
Will
Jul 11 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: pix | last post by:
Hello, I would like to start learning Visual Basic, and I was wondering if there are any recomendations to any ebooks, or actual books for that matter. I have my eye on this book by John Smiley,...
2
by: AK | last post by:
I don't want any part of the previous discussion on Visual Basic versus Visual Basic.Net. My query is about using Visual Basic for Applications; and whether it is better to use Visual Basic 6 or...
14
by: BOOGIEMAN | last post by:
Well that's it, how do I make Windows Application with Python ??? Is there simple way that works 100% ? How can I rework visual design done in VS 2003 to use it for my python program ?
1
by: buran | last post by:
Dear ASP.NET Programmers, I encountered the following problem when running my project: Configuration Error Description: An error occurred during the processing of a configuration file...
2
by: Ralph | last post by:
I used to have Visual Basic .net std. 2003 installed on WinXP SP1A. But I found it too hard to upgrade WinXP to SP2. Now, I do have WinXP SP2 installed, but I am having problems installing...
1
by: Danny Toquothty | last post by:
how can I do these functions in Visual Basic.NET I know how to do it in Visual Basic 6.0 but FILE>Print is not selectable on the form. I also am not able to choose FILE>Make Executable...rather...
2
by: frossberg | last post by:
Hello! I tried to install the Visual Basic.NET Resource Kit (http://msdn.microsoft.com/vbasic/vbrkit/) but obviously something went very wrong and now it sems impossible both to repair and to...
7
by: André | last post by:
Hi, I need several cookies depending of an variable (x), so i defined a HttpCookie() as an array. My problems: 1)I get the error: Object reference not set to an instance of an object. 2)My...
3
by: ruckfules99 | last post by:
Hey, I posted a problem for a game i was making in visual basic 6.0 but i found a way to fix it, so if someone could delete it that would be nice....
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.