hi, I am doing c # and we have just started using DLL nd I have no idea what's going on. Can somebody just give me a brief background and then I want to know how to tackle this; my biggest problem now is that I dont know whether to create DLLs all the way or just one that will represent the Base class then the sub classes as normal classes.
We are asked to create a windows Forms program that will create a Shape class(my base class) and the sub classes of rectangle, triangle and circle that will inherit most attributes from the Shape class.We are told to use DLLs!!!
Help wil be much appreciated
Loading
Avuya MxoliPosted Apr 3, 2011, 10:12 AM
Sam HobbsPosted Mar 31, 2011, 12:06 AM
Mahesh ChandPosted Mar 30, 2011, 11:13 PM
Prior to .NET, a DLL file with physical extension .dll was called a dynamic link library, hence DLL. and then there was something called Static Linked Library. But that was C++.
In .NET, everything (exe or dll) is an assembly and term DLL is replaced with a class library.
If you look at the right side of this post, you will see two tutorials on how to create and use a class library.
I hope it helps and clears a few concepts.
Cheers!
Sam HobbsPosted Mar 30, 2011, 6:41 PM
I would also suggest that it is more meaningful to use the term Class Library instead of DLL but if that is confusing then ignore that. The problem is that the term DLL can be ambiguous and confusing.
VulpesPosted Mar 30, 2011, 6:15 PM
Rectangle rec = new Rectangle(0,0,0,0); // or whatever the constructor requires
// do something with rec
Avuya MxoliPosted Mar 30, 2011, 5:58 PM
Avuya MxoliPosted Mar 30, 2011, 5:54 PM
Sam HobbsPosted Mar 30, 2011, 5:05 PM
So what you want to do is to make a project for a "Class Library". That will create a DLL using managed code that you can easily use with other managed code. What you can do is to create an application that has the classes in it; you can put everything in one Windows Forms application or whatever type of application you need to create. Then later after you have things working you can create a new Class Library project and move the relevant classes to the Class Library. Then add a reference to the Class Library to your application and then replace use of the classes in the application with calls to the Class Library. So do you understand that so far?
VulpesPosted Mar 30, 2011, 3:41 PM