C# DLL
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?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Bechir BejaouiPosted Dec 2, 2008, 1:10 PM
William ThompsonPosted Dec 1, 2008, 7:30 PM
Good answers. But my front-end still does not recognize the DLL's class.
Rajendra, I have taken you up on your offer and sent you an email.
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?
http://i67.photobucket.com/albums/h292/Athono/first_problem.jpg
Strangely, "Equals", "GetHashCode", "GetType" and "ToString" are not seen in the DLL's source code for available methods for this class.
Also, I know that if you double click on the added reference, an Object Explorer should come up showing the available methods. This is not what happens:
http://i67.photobucket.com/albums/h292/Athono/objects.jpg
Bechir BejaouiPosted Dec 1, 2008, 2:53 PM
add using yourdllname; to your porject and you can then use it
Rajendra DeopuraPosted Nov 30, 2008, 11:00 PM
A class named class1 appears. Change the name of the class if you wish. Write the code. After this, go to the Build menu, Select Build Solution. This will create a DLL file named fontassembly.dll. Close the project.
If you want to use this DLL in a Windows Application. Open a New project, Select Windows App. To Import the DLL into the project, Right click on the name of the project and select Add Reference. Browse for the Dll in fontassembly project. This will add the DLL into the project. Now you can write the code and execute It.
I have created a DLL named fontassembly.dll and used in a Windows Application project. If you need this project, drop me a mail at:
[email protected].
I will mail you with attached project.
Thanks
Happy Coding