[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Guidance to create C++ DLL

Posted on 2006-04-16
3
Medium Priority
?
264 Views
Last Modified: 2010-04-01
Hi,

I am new to C++ programming.  We have some C source code which needs to be converted into a C++ DLL.  They are a bunch of C files (.c extension) with each file having a main function and each file including lot of header files (.h extension)

I need a single C++ DLL with methods exposed which will be called from VB.  Which is the best way to do it?

Also we need cross platform compatibility.  Can I use VC++ as it will be more easier for me rather than using C++.

Regards,
Gulabi
0
Comment
Question by:gulabi
3 Comments
 
LVL 12

Assisted Solution

by:rajeev_devin
rajeev_devin earned 200 total points
ID: 16466906
Here are some tutorials
http://www.codeguru.com/Cpp/Cpp/cpp_mfc/tutorials/article.php/c4017/
http://www.codeproject.com/dll/RegDLL.asp

If you have specific questions after reading the tutorial then feel free to revert back.
0
 
LVL 2

Accepted Solution

by:
venkaiah earned 300 total points
ID: 16468029
I am wriiting here a small dll which can be accessible from vb/vc++ .
Exporting only two functions from this dll.

sum.h
-------
int sum(int x,int y);

sub.h
------
int sub(int x,int y);

sum.c
-------
int sum(int x,int y)
{
return x+y;
}
sub.c
------
int sub(int x,int y)
{
return y-x;
}

sum.def
---------
LIBRARY  Arithmatic
EXPORTS
    sum @1
    sub  @2

build this dll and make use of this frm vc++/vb..hope this will helps u.
0
 

Author Comment

by:gulabi
ID: 16491922
Thanks for the posts!

Gulabi
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
Suggested Courses

831 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