Thread: Creating a Wrapper

  1. #1
    Registered User
    Join Date
    Nov 2010

    Creating a Wrapper

    Hi guys + girls,

    This is my second post on the forum. Finding it useful, not been programming with C++ for too long, although am not new to programming in general.


    There is a C++ DLL, Header file and Library. I have been using these within my win32 native C++ projects fine.

    I want to create a wrapper so I can use/call certain functions from a managed language.

    Am I thinking along the right lines with this whole concept (bearing in mind I do not have access to the original DLL's source...)

    1) Create a new C++ DLL project that uses the original DLL and calls functions like the win32 app does. Create methods which do what require using the origna DLL methods.

    2) Create these methods in a way that they can be exported.

    3) Then create a .Net project and use the DLL created above, calling functions from it that go away and do the business and simply return back things of importance back.

    So it would look a little like this:

    getSomething ();
    doSomething ();
    createSomething ();

    My DLL
    __declspec(dllexport) myMethod {creatSomething (), doSomething ()}

    myMethod ();

    Am I along the right lines?

  2. #2
    Registered User
    Join Date
    Nov 2010

    Thumbs up

    Solved...for now anyway.

    There were problems with the properties of the new DLL project.

    I have been doing a fair bit of reading around the subject, passing stuff between the unmanaged and managed etc so if anyone needs some intermediate help on the subject I can give it a shot

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling GNU MP
    By mattnp12 in forum C Programming
    Replies: 3
    Last Post: 06-23-2011, 03:58 PM
  2. Wrapper classes
    By Know_Your_Role in forum C++ Programming
    Replies: 17
    Last Post: 06-10-2009, 01:24 AM
  3. OOP Question DB Access Wrapper Classes
    By digioz in forum C# Programming
    Replies: 2
    Last Post: 09-07-2008, 04:30 PM
  4. Profiler Valgrind
    By afflictedd2 in forum C++ Programming
    Replies: 4
    Last Post: 07-18-2008, 09:38 AM
  5. Creating wrapper for C++ DLL
    By steve1_rm in forum C# Programming
    Replies: 2
    Last Post: 06-10-2008, 07:49 PM