Thread: DLL Import

  1. #1
    Registered User
    Join Date
    Apr 2004
    Posts
    3

    Question DLL Import

    Hi.

    I have a little problem that i just keep hitting brick walls.

    I have a Class that has been compiled into a Dll. I did this by using the new project option and selecting the Win32 application and selecting the dll option. The development Environment is Visual Studio .net.

    Please could someone explain to me (In simple english!) how to include this class into a C# project.

    I've searched on practically everything and I cant seem to grasp the idea.

    Thanks in advance

    Hyder Ali

  2. #2
    Registered User Draco's Avatar
    Join Date
    Apr 2002
    Posts
    463
    Search for <DLLImport> in the help section of your MSVC. I did so and found several articles that should at least get you started. I have MSVC version 6 not .NET, but I'm sure that makes little difference.

  3. #3
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  4. #4
    Registered User
    Join Date
    Apr 2004
    Posts
    3

    Thumbs up Thanks

    Thanks for helping,

    But i still can't get my head around it, i know how to include functions from a C++ dll but i was wanting to include a Class.

    I'll leave it and just convert the class into separate functions.


    Thanks for the help

    Hyder Ali

  5. #5
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    I'm not sure if you can include a C++ class in .NET. You can however create a Managed C++ dll that contains a .NET class that is a wrapper for your native class.

    You can check out this link for an easy example.
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  6. #6
    Registered User
    Join Date
    Apr 2003
    Posts
    31
    hi

    Go to the Solution Explorer then right click on references then choose add references.Then select projects tab then click on browse button, bring up the dll file ( you will find it in bin)

    then click ok

    and in your code use this

    using mydll

    where mydll is your dll file

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Dll Import
    By dankalim in forum C Programming
    Replies: 3
    Last Post: 06-29-2007, 09:37 AM
  2. DLL generated but related import library is missing?
    By George2 in forum C Programming
    Replies: 0
    Last Post: 08-18-2006, 12:13 AM
  3. dll communicating between each other
    By cloudy in forum C++ Programming
    Replies: 5
    Last Post: 06-17-2005, 02:20 AM
  4. DLL and std::string woes!
    By Magos in forum C++ Programming
    Replies: 7
    Last Post: 09-08-2004, 12:34 PM
  5. Import Dll
    By Shakespeare in forum C++ Programming
    Replies: 2
    Last Post: 01-27-2003, 05:40 AM