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

VulpesRank #55 · 29.2K reputationPosted Mar 30, 2011, 11:41 AM EDT
Sam HobbsRank #107 · 20.5K reputationPosted Mar 30, 2011, 1:05 PM EDT
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?
Avuya MxoliRank #7,940 · 231 reputationPosted Mar 30, 2011, 1:54 PM EDT
Avuya MxoliRank #7,940 · 231 reputationPosted Mar 30, 2011, 1:58 PM EDT
VulpesRank #55 · 29.2K reputationPosted Mar 30, 2011, 2:15 PM EDT
Rectangle rec = new Rectangle(0,0,0,0); // or whatever the constructor requires
// do something with rec
Sam HobbsRank #107 · 20.5K reputationPosted Mar 30, 2011, 2:41 PM EDT
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.
Mahesh ChandRank #1 · 393.3K reputationPosted Mar 30, 2011, 7:13 PM EDT
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 HobbsRank #107 · 20.5K reputationPosted Mar 30, 2011, 8:06 PM EDT
Avuya MxoliRank #7,940 · 231 reputationPosted Apr 3, 2011, 6:12 AM EDT