8/29/2011
8/26/2011
Why to use DLL
A DLL is a collection of small programs, which can be called when needed by a larger program that is running in the computer. The small program that lets the larger communicate with a specific device such as printer or scanner is often packged as a a DLL program.
The advantages of DLL:
DLL's don't get loaded in RAM together with the program , so space is saved in RAM(Random Access Memory).
When and if a DLL file is needed, then it is loaded and run. For example, as long as a user of Microsoft Word is editing a document, the printer DLL file does not need to be loaded into RAM. If the user decides to print the document, then the Word application causes the printer DLL file to be loaded and run.
The advantages of DLL:
DLL's don't get loaded in RAM together with the program , so space is saved in RAM(Random Access Memory).
When and if a DLL file is needed, then it is loaded and run. For example, as long as a user of Microsoft Word is editing a document, the printer DLL file does not need to be loaded into RAM. If the user decides to print the document, then the Word application causes the printer DLL file to be loaded and run.
8/24/2011
Why do we need Try-Finally block
The output that the code in the finally block will be executed after throwing the exception. However, the last statements in the program that followed the finally block will not be executed. This means that the exception
prevents control from being transferred to any part of the program except the finally block.
using System;
public class MyClass
{
static void Main()
{
string myString = "Finally";
object myObject = myString;
try
{
// The following conversion is invalid.
// It throws an exception.
int myInt = (int)myObject;
}
finally
{
// The code in this block is always executed:
Console.WriteLine("The program continues and ends here:");
Console.WriteLine("My String is: {0}", myString);
}
// The following code will not be executed:
Console.WriteLine("Hello again!");
}
}
It is also used for cleaning up the resource, like to close the open file stream..
8/07/2011
8/05/2011
8/04/2011
8/03/2011
Subscribe to:
Comments (Atom)