Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
Hi all. I got a piece of code that I have to use as a class. It gets added to the project every time, the accessed from the code of the forms.
It is for ethernet communication to an industrial radio.
So right now it's a just a class called MK
Question:
Is it possible to compile a class into a DLL which then can be just referenced to each application? If so how do I go about it? I can create a DLL application and compile it but then when I reference it I can't access the functions.


Thanx
Posted

Yes its possible. If your project is a class library, the classes gets compiled to a DLL when you build it. Im sure you're already familiar with how to reference the DLL to the other projects. The only lacking thing I think, is that you haven't put in the code the import namespace of the DLL you referenced. This is why, I think, you are not able to access the classes on the code. Hope this helps.
 
Share this answer
 
Comments
Dalek Dave 21-Jul-11 11:01am    
Tick, 5 points
walterhevedeich 21-Jul-11 17:47pm    
Thanks Dave
Make sure the functions that you want accesible are declared as Public not Private.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900