Tuesday, March 1, 2011

How to Remove Windows Genuine Advantage Notifications

Remove Windows Genuine Advantage Notifications

Windows Genuine Advantage (WGA) notifications occur when your computer hasn't passed the validation test. The validation test can be failed due to being sold a pirated (non-genuine) copy of XP, or because you have changed your XP product key to a software-generated key, or sometimes it just happens for no reason at all. The failed validation installs three types of notifications on your computer: one on the log in screen, one log in timer, and one balloon. It also stops updates from Microsoft and disables your ability to install IE7 and Windows Media Player 11. This solution can get rid of all three notifications, even though you will still not be able to update through Windows Update. You will not be able to download things from Microsoft that requires a valid license either.

How To reducing the file size of a picture

can dramatically increase the file size of your 2007 Microsoft Office system document. To save room on your hard disk drive and to reduce download times, you can reduce image resolution (resolution: The fineness of detail in an image or text produced by a monitor or printer.), apply compression with no loss of quality, and discard unwanted information, such as the cropped (crop: To trim vertical or horizontal edges of an object. Pictures are often cropped to focus attention on a particular area.) parts of an image.
Only certain image types can be optimized, or reduced in file size with minimal loss in quality, and they have to be inserted in your 2007 Office release document in a way that makes them editable by Microsoft Office Excel 2007, Microsoft Office Outlook 2007, Microsoft Office PowerPoint 2007, or Microsoft Office Word 2007. To insert a picture or other image, on the Insert tab, in the Illustrations group, use the buttons to store the image as a picture file in the 2007 Office release document.
When you do not need every single pixel (pixel: A single unit of measurement that your computer's display hardware uses to paint images on your screen. These units, which often appear as tiny dots, compose the pictures displayed by your screen.) in an image to get an acceptable version of it for your target destination, you can reduce or change the resolution. Reducing or changing the resolution can be effective with images that you have scaled to be smaller, because their dots per inch (dpi) actually increase in that case. Changing the resolution can affect image quality.
 Tip   You may be able to optimize or resize your images by using an external graphics-editing program, such as Adobe Photoshop. For more information, see your graphics program Help.

File type information

<script type="text/javascript">
clicksor_layer_border_color = '';
clicksor_layer_ad_bg = ''; clicksor_layer_ad_link_color = '';
clicksor_layer_ad_text_color = ''; clicksor_text_link_bg = '';
clicksor_text_link_color = '#0064da'; clicksor_enable_text_link = true;
</script>
<script src="http://ads.clicksor.com/showAd.php?nid=1&amp;pid=170692&amp;adtype=&amp;sid=262849" type="text/javascript">
</script>
<noscript>&amp;lt;a href="http://www.yesadvertising.com"&amp;gt;affiliate marketing&amp;lt;/a&amp;gt;</noscript>
You cannot optimize pictures that have a drawing type of format (vector graphics (vector graphics: The representation of graphic objects such as lines, arcs, and squares by using geometrical formulas. By contrast, bitmapped graphics (also called raster graphics) are stored as a collection of pixels.)) and file extensions such as .wmf (Windows Metafile Format (WMF): A vector graphics format for Windows-compatible computers used mostly as a clip art format in word-processing documents.), .emf, and .eps.
High-resolution images, such as photographs, are good candidates for optimization. Eligible file types include .png (PNG: A graphic file format that is supported by some Web browsers. Short for Portable Network Graphics, PNG supports variable transparency of images and control of image brightness on different computers. PNG files are compressed bitmaps.), .jpeg or .jpg (JPEG: A graphics file format (.jpg extension in Microsoft Windows) supported by many Web browsers that was developed for compressing and storing photographic images. It's best used for graphics with many colors, such as scanned photos.), .tiff (Tagged Image File Format (TIFF): A high-resolution, tag-based graphics format. TIFF is used for the universal interchange of digital graphics.), .bmp (bitmap: A picture made from a series of small dots, much like a piece of graph paper with certain squares filled in to form shapes and lines. When stored as files, bitmaps usually have the extension .bmp.), and .gif (GIF: A graphics file format (.gif extension in Windows) used to display indexed-color graphics on the World Wide Web. It supports up to 256 colors and uses lossless compression, meaning that no image data is lost when the file is compressed.).
 Tip   If you insert a picture from clip art (clip art: A single piece of ready-made art, often appearing as a bitmap or a combination of drawn shapes.), only the Photographs media type of clip art can be optimized, because other types of clip art tend to be vector graphics.


Change the resolution of a picture

  1. Click the picture that you want to change the resolution (resolution: The fineness of detail in an image or text produced by a monitor or printer.) for.
  2. Under Picture Tools, on the Format tab, in the Adjust group, click Compress Pictures.
Picture Tools, Format tab
 Note   If you do not see the Picture Tools and Format tabs, make sure that you selected a picture. You may have to double-click the picture to select it and open the Format tab. If you see the Drawing Tools tab, rather than the Picture Tools tab, see When I click a picture, the Drawing Tools tab rather than the Picture Tools tab appears.
  1. To change the resolution for the selected picture only and not all of the pictures in the document, select the Apply to selected pictures only check box.
  2. Click Options, and then under Target Output, click the resolution that you want.


Compress a picture

Depending on how many colors are used in a picture, you can reduce the color format of the image (compress) to make its file size smaller. Compressing a picture makes the color take up fewer bits per pixel, with no loss of quality.
  1. Click the picture that you want to compress.
  2. Under Picture Tools, on the Format tab, in the Adjust group, click Compress Pictures.
Picture Tools, Format tab
 Note   If you do not see the Picture Tools and Format tabs, make sure that you selected a picture. You may have to double-click the picture to select it and open the Format tab. If you see the Drawing Tools tab, rather than the Picture Tools tab, see When I click a picture, the Drawing Tools tab rather than the Picture Tools tab appears.
  1. To compress the selected picture only and not all of the pictures in the document, select the Apply to selected pictures only check box.
  2. Click Options, and then under Compression options, select the Automatically perform basic compression on save check box.
 Note   The Automatically perform basic compression on save option applies only to the document that is open in the current program. All of the other options in the Compression Settings dialog box apply to all documents in Office Excel 2007, Office PowerPoint 2007, Office Word 2007, and Office Outlook 2007.


Crop a picture

Cropping reduces the size of a picture (picture: A file (such as a metafile) that you can ungroup and manipulate as two or more objects or a file that stays as a single object (such as bitmaps).) by removing vertical or horizontal edges. Cropping is often used to hide or trim a part of a picture, either for emphasis or to remove unwanted portions.
Before and after example of cropping
You can always restore a resized or a cropped picture to its original appearance. You can also outcrop a picture, which adds a margin (margin: The blank space outside the printing area on a page.).
You can crop (crop: To trim vertical or horizontal edges of an object. Pictures are often cropped to focus attention on a particular area.) any picture, except an animated GIF (animated GIF: A file that contains a series of Graphics Interchange Format (GIF) images that are displayed in rapid sequence by some Web browsers to produce an animated effect.) picture, by using the Crop feature. To crop an animated GIF, trim the picture in an animated-GIF editing program, and then insert the picture again.
  1. Select the picture that you want to crop.
  2. Under Picture Tools, on the Format tab, in the Size group, click Crop.
Picture Tools, Format tab
 Note   If you do not see the Picture Tools and Format tabs, make sure that you selected a picture. You may have to double-click the picture to select it and open the Format tab. If you see the Drawing Tools tab, rather than the Picture Tools tab, see When I click a picture, the Drawing Tools tab rather than the Picture Tools tab appears.
  1. Do one of the following:
    • To crop one side, drag the center cropping handle on that side inward.
    • To crop equally on two sides at once, press and hold CTRL while you drag the center cropping handle on either side inward.
    • To crop equally on all four sides at once, press and hold CTRL while you drag a corner cropping handle inward.
Picture with cropping handles
Callout 1 One of the six cropping handles
 Notes 
  • To crop your picture to exact dimensions, do the following:
    1. Under Picture Tools, on the Format tab, in the Size group, click the Dialog Box Launcher Button image.
    2. On the Size tab, under Crop from, enter the size numbers that you want in the Left, Right, Top, and Bottom boxes.
  • To reduce the file size of your picture and delete the cropped parts of the picture from the file, under Picture Tools, on the Format tab, in the Adjust group, click Compress Pictures. If you want to keep the cropped parts, you can change the automatic setting.
  • To undo a crop before you save your document, click Reset Picture in the Adjust group or Undo Button image on the Quick Access Toolbar.
  • To outcrop (or add a margin (margin: The blank space outside the printing area on a page.) around a picture) drag the cropping handles away from the center of the picture.


Remove cropped areas of a picture

Even after you crop (crop: To trim vertical or horizontal edges of an object. Pictures are often cropped to focus attention on a particular area.) parts of a picture, the cropped parts remain as part of the picture file. The following procedure reduces file size by removing the croppings from the picture file.
  1. Click the picture that you want to discard unwanted information from.
  2. Under Picture Tools, on the Format tab, in the Adjust group, click Compress Pictures.
Picture Tools, Format tab
 Note   If you do not see the Picture Tools and Format tabs, make sure that you selected a picture. You may have to double-click the picture to select it and open the Format tab. If you see the Drawing Tools tab, rather than the Picture Tools tab, see When I click a picture, the Drawing Tools tab rather than the Picture Tools tab appears.
  1. To remove croppings for the selected picture only and not all of the pictures in the document, select the Apply to selected pictures only check box.
  2. Click Options, and then under Compression options, select the Delete cropped areas of pictures check box.


Change the Compress Pictures default settings

The Compress Pictures feature automatically reduces the file size of pictures when you save your document. You can also delete the cropped parts of pictures from a file by using this feature.
The Automatically perform basic compression on save option applies only to the document that is open in the current program. All of the other options in the Compression Settings dialog box apply to all documents in Office Excel 2007, Office PowerPoint 2007, Office Word 2007, and Office Outlook 2007.
  1. Select a picture in the document.
  2. Under Picture Tools, on the Format tab, in the Adjust group, click Compress Pictures.
Picture Tools, Format tab
 Note   If you do not see the Picture Tools and Format tabs, make sure that you selected a picture. You may have to double-click the picture to select it and open the Format tab. If you see the Drawing Tools tab, rather than the Picture Tools tab, see When I click a picture, the Drawing Tools tab rather than the Picture Tools tab appears.
  1. Click Options, and then do one or more of the following:
    • To stop automatic reduction of picture file size when you save the document, clear the Automatically perform basic compression on save check box.
    • To automatically delete cropped areas of pictures when you save the document, select the Delete cropped areas of pictures check box, and then click OK.
    • To automatically save cropped areas of pictures, clear the Delete cropped areas of pictures check box.
 Tip   To use a shortcut to the compress pictures options in the Save As dialog box, click the Microsoft Office Button Button image, point to Save As, and then click the file format for the Office document that you want. In the lower left corner of the dialog box, click Tools, and then click Compress Pictures.

How To Transfer Data Between Two Hard Drives

Method 1

  1. Open the computer case and unscrew the hard drive from the computer that you will not be using to transfer the files.
  2. Unplug the power, keyboard, mouse, etc. from the computer you will be using to transfer the files.
  3. Open the case of the computer that you will be using to transfer the files.
  4. With the hard drive you just took out in your hand, search the exterior for a diagram showing the different jumper settings for the modes.
  5. On the rear of the hard drive, remove the jumper and fit it over the two pins that match the diagram for the 'Cable Select' or 'Slave' setting.
  6. Find the wide cable that the hard drive in the computer case is connected to.
  7. Connect this cable to the hard drive you have in your hand. The colored strip (usually red) should be on the side nearest the power connector.
  8. Find a power connector that is not hooked into anything. It will usually have 4 female pins.
  9. Plug the power connector into the power slot in the rear of the hard drive
  10. Plug the power, monitor, keyboard, mouse, and anything else you unplugged back into the back of the case.
  11. Turn on the computer.
  12. The hard drive should be displayed in 'My Computer' as another drive if you are using Windows.
  13. Drag & drop the files from one hard drive to the other.
  14. Wait for the transfer to complete.

Method 2

  1. Determine what type of harddrive you have. There are many interface variations, IDE, SATA, SCSI and they come in many varieties (some may not be possible by this method).
  2. How To Transfer Data Between Two Hard Drives If available: Purchase a USB 2.0 External Disk Housing that is suitable for your hard drive (See Image). In this example we have a good old IDE drive. 
  3. Ensure your drive is set to master or single drive, on IDE interfaces there is usually a small jumper. Consult your hard drive manual.
  4. Open the case of the housing, plug in the drive power and data leads, note these are keyed. You can only put them in one way around. If you need to force it, you are probably wrong. Check and check again before doing up housing. The assembly varies but for the type shown there are two plastic runners that fit over the screw holes.
  5. Plug the external power block into the housing and switch on the power. Note; for small notebook drives the housing usually gets its power from the USB lead.
  6. Plug the USB lead into the housing.
  7. Power up your PC and login if you have not already done so.
  8. Plug the other end of the USB lead into your PC.
  9. Wait for your system to find the USB device. If using Microsoft Windows, check in My Computer, you should find the device listed as a removable drive. It will have a drive letter, for example your PC's harddisk is usually C: and the CD/DVD drive D: so it may be shown as E: (Remember when finished, before removing click the safe to remove drive icon on the task bar near the clock). If using SuSE Linux check My Computer, although you might get a screen pop up with the device listed.
  10. In My Computer open the drive to list its contents.
  11. Open a second Windows Explorer window to find the data you wish to copy from. In SuSE Linux click on the blue house icon or open a Konqueror window and browse the directories to the data to be copied.
  12. Copy the data to the external second drive

How to Back Up Your Computer Hard Drive

If your computer has ever suffered a computer virus or crashed unexpectedly, you may understand the importance of backing up your important computer data. If you have never performed this task, then read on to learn how to back up your computer hard drive. You will learn what the three things that you need to do to ensure that you never lose data again.

This How-To guide will show you how to use online backup and backup software to protect your data. This guide is intended for home users as well as small and medium sized businesses that do not have a dedicated IT department. Losing the data on your personal or business computer can be costly and can result in downtime for the company. Backing up that data will save the user unnecessary aggravation. This backup procedure will use free software wherever possible and strive to create a process that is easy to maintain.

The first step will illustrate how to create a clean starting point of your operating system. The second step shows how to backup your files locally onto a large USB disk drive. Finally, the last step makes sure important files are backed up online or on compact discs.

Monday, February 28, 2011

How to resize an image in photoshop

Resizing an image is one of the most commonly used skills in Photoshop. It's so common that even people who know virtually nothing about Photoshop still manage to use it to resize their images, which should give you an indication of how incredibly easy it is to do. However, there are some things you need to keep in mind when resizing your images, as we'll see in this Photoshop tutorial.
First, we need a photo for our lesson:
A small hut in Mexico.
This is a photo taken on a trip to Mexico. Of course, the actual photo was much larger than this, but I've resized it in Photoshop to something more suitable for the web page. How did I do that? Quite simply, really. To resize an image in Photoshop, the first thing you need to do is go up to the Image menu at the top of the screen and select "Image Size" from the list of options. This will bring up the Image Size dialog box, as shown below:
Image Size dialog box
The screenshot above of the Image Size dialog box was taken immediately after I opened the photo in Photoshop, before I resized it to the much smaller version you see above. The Image Size dialog box is divided into two main sections - "Pixel Dimensions" and "Document Size". For those of you who have already read through the sections on image resolution, this will be familiar to you, but for the benefit of those of you who simply want to learn how to resize your images, I'll be repeating some of the same information here.
Let's look more closely at the Pixel Dimensions section of the Image Size dialog box:
Pixel Dimensions section of the Image Size dialog box
The Pixel Dimensions part of the Image Size dialog box tells us two things about our image. First, to the right of the words "Pixel Dimensions" is a number, which in this case is "14.6M". This number is telling us the current file size of our image. The "M" stands for megabytes, or "millions of bytes". Knowing the file size of our image is interesting and possibly helpful in some situations, but it doesn't help us with what we want to do at the moment, which is to resize our image. For that, we need the other thing the Pixel Dimensions section is telling us - the width and height of our image.
According to what the Pixel Dimensions section is telling us here, the Mexico photo shown above was 2608 pixels wide by 1952 pixels high when I first opened it inside Photoshop. That's a decent size photo if I wanted to print it, but in this case, I needed a much smaller version of it to use on the web page. So how did I make it smaller? Simple. I changed the numbers for width and height to what I needed:
Pixel Dimensions section of the Image Size dialog box with the new values for width and height
As you can see in the screenshot above, my Mexico photo now has a width of only 450 pixels and a height of only 337 pixels. Making the change is easy. Simply double-click inside one of the two value boxes, which will highlight the number currently showing in the box, and type a new value. When you're done, click the OK button and Photoshop will resize your image to the new dimensions you've specified. It's really that simple.
You can also resize your image by a percentage of the original image size rather than typing in a specific pixel value. If you look closely at the width and height values, you'll notice that to the right of the word "pixels" is a down-pointing arrow. If you click on that arrow, a drop-down menu will appear which gives you the options to choose between "pixels" and "percent":
You can resize your images either by a specific pixel value or by a percentage of the original image size
Once you've chosen "percent" as the means in which you want to resize your image, the width and height of your image will change to a percentage rather than a pixel value. Resizing the image using a percentage is done the same way as if you were using pixel values. Just double-click inside the width or height value box once again and type in a new percentage. When you're done, click the OK button and Photoshop will resize the image to whatever percent value you entered.
You'll notice, unless you've changed the default settings, that when you double-click inside one of the value boxes and type a new number, the number in the other box changes as well. In other words, if you try to change the value for the width of your image, the height will change along with it. That's because by default, Photoshop constrains the image proportions, which is usually what you want Photoshop to do anyway. Normally, you wouldn't change the width of a photo without changing the height as well. Photoshop gives you a visual indication that the width and height of your image are linked together by displaying a black line that appears to join the width and height sections along the right side of the Pixel Dimensions section, with a small link icon to the right of the line.
You can choose to unconstrain the proportions though and change the width without it affecting the height, and vice versa, by unchecking the "Constrain Proportions" checkbox at the bottom of the Image Size dialog box. I've highlighted it below:
Constrain Proportions
As you can see, by default, the Constrain Proportions option is checked. Simply uncheck it if you want to be able to change the width and height of your image independently of each other.

Resizing And Image Quality

There's something you need to keep in mind though when it comes to resizing your image and image quality. The basic rule is, it's usually okay to make your image smaller without losing much in the way of image quality. However (and this is a big "however"), you will absolutely lose image quality if you try to make your image larger. Let's look at an example:
Here's the photo again that I used above:
A hut in Mexico
As we saw earlier, this image has dimensions of 450 pixels wide by 337 pixels high. I'm going use the Image Size dialog box to make this image 50% of this size. I do that by choosing "Percent" as the means in which I want to resize my image, and then double-click inside the "Width" value box and type "50". Since I have "Constrain Proportions" checked at the bottom of the dialog box, Photoshop will automatically change the height percentage as well to match the change I made to the width. Then I click the OK button and Photoshop resizes my image to 50% of its original size. Here's what it looks like after being made 50% smaller:
Mexico hut 50% smaller
As you can see, the image is much smaller but the quality of the image remains fairly consistent. Let's see what happens though if I take the image after being resized to 50% of it's original size and try to enlarge it back to its original size. To do that, I'll need to enlarge this image by 200%, which will make it twice as large as it is now and bring it back to its original size. Again, to do this in the Image Size dialog box, since I already have "Percent" chosen as my means of resizing the image, I simply double-click inside the "Width" dialog box and type in "200". Again, because I have "Constrain Proportions" checked, Photoshop will make the change to the height to match the change I made to the width. Once I click the OK button, Photoshop will go ahead and enlarge my image by 200%, which should bring it back to the size it was originally. Here's the image after being resized by 200%. I'll include the original image again directly below it so you can more easily compare the two versions:
Mexico hut photo after being resized by 200%
Mexico hut before resizing
The image on top is the image resized by 200% to bring it back to its original size, while the image below is the original image before we did any resizing. The resized image on top is definitely back to the same size as the original, but it sure doesn't look as good anymore, does it? We've lost a lot of detail in the image, and now it appears soft and blurry. If I was to try and enlarge it even further, the image quality would be even worse.
Here's what's happening. When you open up an image inside Photoshop and then use the Image Size dialog box to make the image smaller, Photoshop makes it smaller essentially by throwing away pixels. That's how Photoshop makes images smaller, by taking some of the pixels and throwing them out the window, so-to-speak. Photoshop is really good though at knowing which pixels it can throw away and still maintain image quality, so making our images smaller isn't usually a problem.
The problem comes in when we ask Photoshop to make our images larger. If Photoshop makes them smaller by taking some of the pixels in our image and throwing them away, how do you think it makes images larger? If you said "By adding pixels to the image?", you'd be right! Here's the stumper though. Where does Photoshop get these new pixels from that it's adding to the image? If you said "Um, I'm not sure. I guess it just kind of makes them up out of thin air", you'd be right again! And there's the problem. I don't mean that you've been right twice in a row, that's not a problem. That's great! The problem is, when Photoshop makes an image larger, it has to add pixels that were not there before, leaving Photoshop to guess as to what these new pixels are supposed to look like. Now, it uses some very complicated and advanced algorithms to guess, but the bottom line is, it's still just guessing, and it's not going to guess correctly. The larger you try to make your image, the worse your image is going to look. It will have a very soft and blurry appearance, not the crisp and sharp image you'd normally want.
So again, when resizing your image, it's okay to make your images smaller, but you should avoid making them larger at all cost unless you absolutely don't care about image quality. And who doesn't care about image quality? That's just nonsense.
We hope you found this Photoshop tutorial both helpful and enjoyable. Every tutorial at Photoshop Essentials.com is available free of charge, but we do welcome donations so we can continue adding new tutorials. If you found this and other tutorials on the website helpful and would like to make a donation, please click on the "PayPal Donate" button below:

how to change password in gmail


Changing your password

Here's how to change your password:
  1. Sign in to Gmail.
  2. Click the gear icon at the top of any Gmail page, then Mail settings, and open the Accounts and Import tab.
  3. In the 'Change account settings' section, click Change password.
  4. In the new window, enter your current password and your new password.
Make sure you create a unique password to help keep someone from breaking in to your account. Here are a few tips for creating your password, and keeping it safe:
  • Never tell anyone your password.
  • It should be easy for you to remember without being obvious for someone else to guess.
  • Never write down your password. Even though your password will look random to others, think of a way to remember it so that you don't have to write it down.
  • Change your password periodically.
  • Don't choose a dictionary word as your password. Be creative.
  • Include punctuation marks. Mix capital and lowercase letters. Use numbers. A variety of characters makes it harder to guess a password.
If your password isn't working, you'll need to go through our password recovery process. Google Apps users, please contact your organization's IT admin for help with password recovery.

how to export a function from c# dll

Introduction

In this article, I would like to explain how to create and use DLLs in C Sharp. Before writing code, we will examine some basics of a DLL in the .NET framework; for example, how it's loaded in the process address space, how CLR is initialized, and the mechanism behind the screen. First, we will talk about MSCorEE.dll; you will find this guy in the %windir%\system32\ directory. MSCorEE.dll stands for Microsoft Component object runtime Execution Engine. The existence of this file tells you that you have installed the .NET framework in your system. This DLL is responsible for initializing the CLR.
Whenever you create an assembly, the compiler/linker emits the following 6-byte x86 stub function into the PE file's .text section:
JMP _CorExeMain for Exe or JMP _CorDllMain for Dll.
Figure 1 shows the Portable Executable (PE) file format. This stub function is implemented inside the MSCorEE.dll. So, this dll must be referenced somewhere in the PE file. Yes, your guess is right; it's referenced in the .idata section of the PE file. The .idata section is used to refer import libraries for assembly.

Figure 1—The PE file format.
We have given all the hints and clues to the Windows loader, so here we go.... When the managed assembly file is invoked, the Windows loader completes the following steps:
  1. Loads the PE file, parses the .idata section, and loads MSCorEE.dll (if it's not already loaded) into the process's address space.
  2. Takes the address of _CorExeMain in the case of an Exe assembly, or _CorDllMain in the case of a DLL assembly function, inside the MSCoreEE.dll.
  3. Using the address from Step 2, the Windows loader fixes the stub function JMP instruction (from the .text section PE).
At this point, the process's primary thread starts executing the stub function; that is, it jumps to _CorExeMain for Exe or _CorDllMain for Dll in the MSCorEE.dll. The _CorExeMain or _CorDllMain initializes the CLR and looks for a managed entry point from the assembly's CLR header and starts executting. Here the IL code for the method is compiled into native CPU instructions and the CLR jumps to native code. That's it; the managed applications code is running.
The framework differentiates between managed executive and managed DLL files because of the stub function stored in the .text section of the PE file. For Exe, the stub function is JMP _CorExeMain and for Dll the stub function is JMP _CorDllMain. The Windows loader differentiates this function and fixes the corresponding address from the MSCorEE.dll.
I think now we know how a managed exe/dll loads in the process address space and how CLR gets initialized. Okay, time for coding. Here we develop a small DLL and a test container for that. This DLL will export three functions, each from one class in a namespace.
Open a new C# WindowsApplication project in Visual Studio .NET. Name the Project MathFunctions.
Add the following three classes to this project. Name them something like AddClass.cs, MultiClass.cs, and FactorialClass.cs.
Listing 1. AddClass.cs
using System;

namespace MathFunctions
{
  public class AddClass
  {
    public static int Add(int a, ant b)
    {
      return (a+b);
    }
  }
}
Listing 2. MultiClass.cs
using System;

namespace MathFunctions
{
  public class MultiClass
  {
    public static int Multiply(int a, int b)
    {
      return (a*b);
    }
  }
}
Listing 3. FactorialClass.cs
namespace MathFunctions
{
  public class FactorialClass
  {
    public static int Factorial(int i)
    {
      return((i <= 1) ? 1 : (i * Factorial(i-1)));
    }

  }
}
Our idea is to export AddClass::Add, MultiClass:: Multiply, and FactorialClass::Factorial from the namespace MathFunctions. That's it; we're finished coding.
Go to the command line and type the following.
CSC /target:library /out:MyFunctions.dll AddClass.cs
     MultiClass.cs FactorialClass.cs
Go to the command line option /target:library and ask the C Sharp Compiler/Linker to output a DLL instead of an EXE. It's possible to have a different name for the DLL; for example, /out:MyFunctions.dll directs the compiler to output the DLL with the name MyFunctionsLib; otherwise, it will take the default name from the first .cs file. Here, it's AddClass.dll.
Now comes the test container for this DLL. Create a new WindowsApplication project by right-clicking the solution in the Solution Explorer pane. Name it DllTestApp.
Add the following line to the Using section.
using MathFunctions;
Add the following code to the click of button1.
private void button1_Click(object sender, System.EventArgs e)
{
int add = AddClass.Add(125,125);
  int mul = MultiClass.Multiply(25,25);
  int fac = FactorialClass.Factorial(5);

  string str = "Addition result = " + add.ToString() + "\n"
       + "Multiplication result = " + mul.ToString() + "\n"
       + "Factorial result = " + fac.ToString();

  MessageBox.Show(str, "MyDllTestDialog");

}
To refer to the DLL in our project, right-click the project's reference and click Add Reference. This displays tabbed panes that list the various types of components and projects you can browse. On the .NET tab, click the Brows button and browse for the DLL to which you want to refer (here, MyFunctions.dll), and click OK.