Click here to Skip to main content
15,911,132 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Friends.

I am working in VB.Net 2008 from two years. I have a serious confusion. I want to know that why we write classes and functions etc in a separate DLL file and then use it in our EXE, while we can write these classes and functions also in our EXE file.
Can some one Plz give me a brief answer of my question.

Waiting for Answer.
Posted
Updated 21-Sep-10 4:23am
v2

Reuse. You can use dll's in executables, Matlab, Excel, Statistical packages, ....
 
Share this answer
 
Comments
rashidfarooq 21-Sep-10 10:24am    
Brother You could not understand my question. I want to know that the code that we can write direct in Exe, why we write that code in a separate dll file and then call it from Exe.
Marc A. Brown 21-Sep-10 10:36am    
He *did* answer your question. You put things in a DLL in order to reuse them in another project. Now if you're asking why *you're* putting stuff that you can't/won't reuse elsewhere into a DLL, you're asking us to read your mind.
Baji Jabbar 22-Sep-10 4:52am    
@rashidfarooq Reusing is not coping and pasting code. I was also having the question for a long time. "Why should we have to make a class as a dll for reusing , we have the code and we can copy and paste" .This was in my mind and hope this is in yours. And you already got the answer from others. For reusing :)
You put stuff in a dll that you might want to reuse in several other places so that you don't have to put that code in several different exe. Then if that code needs to be changed for any reason you only have to change it once and then refresh the dll. For example, my company has a dll that contains a bunch of calculators. We have a couple different websites and a PC program that all use the same calculations. So instead of putting that code in each website and in the PC program's exe we have it in a dll and each website and the pc program refer to it.
 
Share this answer
 
Check this out.
 
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