Sunday, November 7, 2010

Quotes

Chase excellence and success will follow. ~ 3 Idiots
If you don't stand for something, you will fall for anything. ~ Malcolm X
If you tell the truth, you don't have to remember anything. ~ Mark Twain

Friday, October 8, 2010

Visual C#

Here are the list of books suggested for Visual C# on msdn.

Visual C++

Here is a link for Visual C++ Books suggested on msdn.

Tuesday, October 5, 2010

Quotes

What you are is not what you are and what others are telling you is, what you are. ~ MLS Shastri
Analogies and Anecdotes are common in the lectures of MLS Shastri, who used to run a training institute called Uttara (Located at Rajaji Nagar, Bangalore, India). He was conducting training's (through Audio recorded sessions) for C, C++ and Advanced Unix. His teaching was very unique in nature and he had a great comprehension on the subject.

I admire his talent and no doubt, he is a great inspiration to many. I feel extremely honored to have attended his classes (in 2003). That’s one of the best things that has ever happened in my life.

It’s a big pain, curbing myself to describe him this succinctly. Lastly, Kudos to him!

Saturday, September 25, 2010

Windows Installer Information | C#

When you are working with Installer applications. At times, you may have to find properties of underlying components inside Installer (.msi) packages. MSI does maintain a database of all the properties of underlying items.  

Windowsinstaller can be used to find this information. Usage of the WindowInstaller has already been published in another post.

The below C# method helps you to find a property of an underlying component:
The above method takes two parameters sMsiFilePath - indicates the exact path of the .msi file and sProperty is the name of the property(e.g. Version) to find and returns the the property value as a string.

e.g. GetMSIProperty("C:\Test\Setup.msi", "DisplayVersion"); // to make a call to the above method

Friday, September 24, 2010

x32 Or x64? | C#

Developers more often, want to know the processor type (32 bit or 64 bit) to make some programming decisions. It usually happens, when you write applications for 64 bit machine. Registry entries are also added on different paths for 32 bit and 64 bit Applications.

When you install a 64 bit application, the entry in the registry will be made under the below path: And a 32 bit application will make an entry under the following path: The below C# code detects the processor type of the machine, where your application is running:
In the above code, PROCESSOR_ARCHITECTURE is the environment variable, which carries the information of the system type. Environment is the class (part of the System namespace) to expand the environment variable to extract the machine architecture.

Thursday, September 23, 2010

Century

100 Posts in MSDN

Monday, September 20, 2010

Make Your Bitmaps Transparent | C#

Scenario #1: Comparing with Visual C++, It is easy to make a bitmap (.jpeg, .bmp and .png) in C#. Code to make a bitmap back ground transparent on a picture control:
Two things here, picBox (Picture Box control instance) back(ground) color is setting to Transparent. And Making the BmpOne (Bitmap object) transparent.

Scenario #2: Code to make the ImageList images transparent:
iconsList (Of type ImageList) contains two icons here. This iconsList can be leveraged to set images on ListView controls, Radio Buttons and Labels etc.

Saturday, September 18, 2010

Don't be another brick in a wall.
Came across this in one of the english movies (and don't remember the movie name). There was a context in the movie, where two friends were chatting with each other and one suggests the other, "Do whatever you want but don't be another brick in a wall". He meant to say that do something different.

Thursday, September 9, 2010

Is patch'ed? | C#

Patches are usually being applied to all the products/softwares to come around various issues that the end users do face over the period of time while using any software. These are also called with other names as Hot or Quick fixes, which are normally being identified by a number prefixed with KB (e.g KB2508987).

While creating setup (or InstallShield) applications, It is usually a case of detecting whether or not a specific patch is installed?. Knowing that, the installer can prompt the user to add it first before moving on with the installation. The below is a C# code that will detect whether a particular patch has been applied for particular product.

Follow the below 3 easy steps:
1) Add msi.dll to the project.

2) Add WindowsInstaller namespace.
using WindowsInstaller;
3) Add the below code to detect the patch.
Type type = Type.GetTypeFromProgID("WindowsInstaller.Installer", true);
if (type != null)
{
    WindowsInstaller.Installer installer = (WindowsInstaller.Installer)   Activator.CreateInstance(type);
    if (installer != null)
    {
        WindowsInstaller.StringList patches = installer.get_Patches("{049DB35D-4A8B-4DFF-A9EF-D7142186BDFD}");

        foreach (string patch in patches)
        {
           if (patch == "{011FF98E-2A9E-1AEE-D2DE-F2135786CDEF}")
           {
               // found
               break;
           }
        }
    }
}