C# dll

General software, Operating Systems, and Programming discussion.
Everything from software questions, OSes, simple HTML to scripting languages, Perl, PHP, Python, MySQL, VB, C++ etc.
Post Reply
User avatar
complete
Member
Posts: 75
Joined: Fri Aug 26, 2005 11:08 am

C# dll

Post by complete »

After someone creates a DLL in C# using the Microsoft Visual development environment, how would another programmer take that code, make a new project that includes the DLL's source and make a GUI that uses the DLL'S API?
User avatar
A_old
Posts: 10663
Joined: Sun Jan 30, 2000 12:00 am
Location: Atlanta

Post by A_old »

IIRC, You can import a dll by right clicking on a project and choosing add resource (I think -- been a while since I used Visual Studio), then clicking browse and selecting the dll in the file browser. You can then import and use the classes contained in the dll normally.
User avatar
complete
Member
Posts: 75
Joined: Fri Aug 26, 2005 11:08 am

Post by complete »

Amro wrote:IIRC, You can import a dll by right clicking on a project and choosing add resource (I think -- been a while since I used Visual Studio), then clicking browse and selecting the dll in the file browser. You can then import and use the classes contained in the dll normally.

I have done a few things. I have created a console app to use as the front-end to the project. Then I have added the DLL as a reference like this:

1) In the Solution Explorer right-click "References" and select "Add Reference ...".

2) Select the "Browse" tab.

3) Navigate to the DLL and select it.

4) Add the appropriate using directive to the code file(s) where you want to use the DLL.


I have also found that I can add the Project that the DLL was made in into my new Solution file.

I have included the namespace of the DLL in the "using" section of my code.

And the intelligent type I am using recognizes this class when I declare it in my code.

But it does not seem to recognize all the methods (api's) of the class.

What am I doing wrong?

Image

Strangely, "Equals", "GetHashCode", "GetType" and "ToString" are not seen in the DLL's source code for available methods for this class.
Post Reply