please help me to convert a C++ code into .dll

Hello,

I have an already made project in C++ and I need to use its functions in my C# project.

I think that I must convert it into .dll file, but I am very confusing in how to get a .dll file , that can be referenced in C# project , from a C++ code files.

I am reading many articles about that but I can't apply any one.

Please help me to doing that.

If anybody can help me please give me the e-mail to send the C++ code.

Or it can be accessed from the web site :

www.cs.rpi.edu/~zaki/software

useing the link:

CHARM.tar.gz

if anybody can convert it please post it to me.

my e-mail address is:

aya_el_zoghby@yahoo.com

Thanks in advance for any help.

Aya.



Answer this question

please help me to convert a C++ code into .dll

  • Teddy Chen

    Ok , thanks for your reply.

    But can you give me the idea , how can I doing it myself in clear steps, since I am trying many methods but always I have problems.

    Thanks again and I'm sorry if I irk you.

    Aya.


  • erSudev

    OK,

    Now how can I start the VC++ wizard for creating the DLL

    Thanks,

    Aya.


  • Anjan Das

    Ayooya wrote:

    Ok , thanks for your reply.

    But can you give me the idea , how can I doing it myself in clear steps, since I am trying many methods but always I have problems.

    Thanks again and I'm sorry if I irk you.

    Aya.

    First you need to figure out how to write a DLL that exports some C functions. The VC++ wizard generates a DLL for you with commented out code that exports a function. Looking at the code should help you out. Create a test DLL and export a few functions.

    Now with C#, learn how to use DllImport - lots of samples on MSDN, CodeProject and other sites. Using DllImport you can P/Invoke the required functions from the C-based DLL. First, practise with the simple DLL you created, and ocne you get the hang of it, start porting your code.

    That should get you started.



  • Kamyar Mohajerani

    Ayooya wrote:

    OK,

    Now how can I start the VC++ wizard for creating the DLL

    Thanks,

    Aya.

    New Project - Visual C++ - Win32 - Win32 Project - Application Settings - set app type to DLL, and tick Export Symbols. Now VC++ will generate the required minimal code.



  • abhishek.cbsa

    Hello Ayooya

    While people here are very willing to help you with specific issues, I don't think anyone here is free enough to spend half a day (or more) to do your work for you.

    If you really do not want to do this on your own, you could consider contracting someone on an hourly basis. Try sites like Rent-a-coder where you may find affordable proposals for your work - note that I have no idea if the site and its clients are reliable, since I've never worked with them.

    Ayooya wrote:

    Hello,

    I have an already made project in C++ and I need to use its functions in my C# project.

    I think that I must convert it into .dll file, but I am very confusing in how to get a .dll file , that can be referenced in C# project , from a C++ code files.

    I am reading many articles about that but I can't apply any one.

    Please help me to doing that.

    If anybody can help me please give me the e-mail to send the C++ code.

    Or it can be accessed from the web site :

    www.cs.rpi.edu/~zaki/software

    useing the link:

    CHARM.tar.gz

    if anybody can convert it please post it to me.

    my e-mail address is:

    aya_el_zoghby@yahoo.com

    Thanks in advance for any help.

    Aya.



  • please help me to convert a C++ code into .dll