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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Rajendra Deopura139 reputationPosted Nov 30, 2008, 6:00 PM EST
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
Bechir BejaouiRank #144 · 15.9K reputationPosted Dec 1, 2008, 9:53 AM EST
add using yourdllname; to your porject and you can then use it
William Thompson155 reputationPosted Dec 1, 2008, 2:30 PM EST
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 BejaouiRank #144 · 15.9K reputationPosted Dec 2, 2008, 8:10 AM EST