Guidance to create C++ DLL

Posted on 2006-04-16
Last Modified: 2010-04-01

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++.

Question by:gulabi
    LVL 12

    Assisted Solution

    Here are some tutorials

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

    Accepted Solution

    I am wriiting here a small dll which can be accessible from vb/vc++ .
    Exporting only two functions from this dll.

    int sum(int x,int y);

    int sub(int x,int y);

    int sum(int x,int y)
    return x+y;
    int sub(int x,int y)
    return y-x;

    LIBRARY  Arithmatic
        sum @1
        sub  @2

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

    Author Comment

    Thanks for the posts!


    Featured Post

    Courses: Start Training Online With Pros, Today

    Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

    Join & Write a Comment

    This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
    This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
    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 goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

    746 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

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now