Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / July 2006

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Carlos Villaseñor M. - 11 Jul 2006 09:58 GMT
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.
Marcus Heege - 11 Jul 2006 14:08 GMT
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

> Hi Everybody!
>
[quoted text clipped - 6 lines]
> Thank you
> Carlos Villaseñor M.
William DePalo [MVP VC++] - 11 Jul 2006 14:17 GMT
> 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/default.asp?url=/library/en-us/cptools/html/cp
grfAssemblyRegistrationToolRegasmexe.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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.