?
Solved

Wrtining a COM DLL in either VC6 or 7

Posted on 2003-03-28
3
Medium Priority
?
333 Views
Last Modified: 2013-12-14
I have an application that was written in VC6 with MFC support.  It consists of a .exe user interface dialog and two dialog app DLL's that get called from the .exe that runs under NT4.0.  I now have to port the app. to 2000 and replace the VC++ .exe user interface with a VB .NET front end.  Since the original .exe passes data structures to the DLL's I wanted to replace this functionality of passing data structure parameters functionality by compiling the DLL's as type libraries so the VB .NET front end could call the functions as if they exist in the VB .NET app.  This is done by adding a reference to the VB project and it works fine using VB6.  When moving to the VB .NET environment however the DLL's it appears have to be COM compliant DLL's in order to be Added as a reference to the VB .NET project.
I don't have the foggiest idea how to create a COM DLL as there is no option in the DLL wizard that includes COM support in VC6 and I have no real experience with VC7 to know if it is a built for DLL's.
0
Comment
Question by:johnsla
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 10

Accepted Solution

by:
makerp earned 500 total points
ID: 8230017
i think that what you need to do is use VC++ and create an ATL application (its listed in the new -> projects dialog). You can then create wrapper classes to wrap you existing code.. i have done this in the past to make old C style stuff availble to VB script etc.

once you have created the project you can create a number of simple objects which are basic COM objects that can be created in VB Script, .Net etc. to do this right click on the project in class view and select new ATL object.

each object will be abstracted by a C++ class, you can add methods to this using the wizards (right click on the class in question, add method etc). if you now what you are doing you can side step the wizards but you will have to create all the IDL code etc yourself if you do this. the wizards add entries to the IDL files for you so its quick and easy.

before going mad and porting code i would write a simple one that has a single method that say returns a number just to test the principle
0
 
LVL 9

Expert Comment

by:tinchos
ID: 9566413
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Answered by: makerp

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Tinchos
EE Cleanup Volunteer
0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question