Wednesday, June 1, 2011

Re-Create Desktop Icon In Win XP

Recently I ended up in deleting the Show Desktop icon from my Quick Launch Bar accidentally. I needed the button back in place badly since I mostly have lot of windows open most of the time. Show Desktop icon was a handy for accessing my Desktop. So I was researching ways to restore my Show Desktop icon back in place and I have found the following solution.

Manually recreate the Show Desktop icon
Create a text file with the extension .scf (preferably Show Desktop.scf). SCF stands for Shell Command File. SCF files are executed by shell32.dll and the file extension is one of the special ones that remain hidden even if you instruct Windows to show file extensions. Paste the following code into the file.

[Shell]
Command=2
IconFile=explorer.exe,3
[Taskbar]
Command=ToggleDesktop

Save the file and place the same in Quick Launch bar and now you’re done.

Using the Regsvr32 command
This one is pretty simple, just go to run prompt or command prompt and type in the following command.
regsvr32 /n /i:U shell32.dll

The regsvr32 command line tool used to register .dll as command components into the registry. The above command with instruct Windows to register shell32.dll with optional install string, which enables Show Desktop icon back into place.
The Show Desktop icon file should be available now automatically in Quick Launch bar after executing the regsvr32 command.

Abstract Vs Interfaces

Background
An Abstract class without any implementation just looks like an Interface; however there are lot of differences than similarities between an Abstract class and an Interface. Let's explain both concepts and compare their similarities and differences.

What is an Abstract Class?
An abstract class is a special kind of class that cannot be instantiated. So the question is why we need a class that cannot be instantiated? An abstract class is only to be sub-classed (inherited from). In other words, it only allows other classes to inherit from it but cannot be instantiated. The advantage is that it enforces certain hierarchies for all the subclasses. In simple words, it is a kind of contract that forces all the subclasses to carry on the same hierarchies or standards.

What is an Interface?
An interface is not a class. It is an entity that is defined by the word Interface. An interface has no implementation; it only has the signature or in other words, just the definition of the methods without the body. As one of the similarities to Abstract class, it is a contract that is used to define hierarchies for all subclasses or it defines specific set of methods and their arguments. The main difference between them is that a class can implement more than one interface but can only inherit from one abstract class. Since C# doesn't support multiple inheritance, interfaces are used to implement multiple inheritance.

Both Together
When we create an interface, we are basically creating a set of methods without any implementation that must be overridden by the implemented classes. The advantage is that it provides a way for a class to be a part of two classes: one from inheritance hierarchy and one from the interface.
When we create an abstract class, we are creating a base class that might have one or more completed methods but at least one or more methods are left uncompleted and declared abstract. If all the methods of an abstract class are uncompleted then it is same as an interface. The purpose of an abstract class is to provide a base class definition for how a set of derived classes will work and then allow the programmers to fill the implementation in the derived classes.
There are some similarities and differences between an interface and an abstract class as arranged in a table for easier comparison:

Feature

Interface

Abstract class

Multiple inheritance

A class may inherit several interfaces.

A class may inherit only one abstract class.

Default implementation

An interface cannot provide any code, just the signature.

An abstract class can provide complete, default code and/or just the details that have to be overridden.

Access Modfiers

An interface cannot have access modifiers for the subs, functions, properties etc everything is assumed as public

An abstract class can contain access modifiers for the subs, functions, properties

Core VS Peripheral

Interfaces are used to define the peripheral abilities of a class. In other words both Human and Vehicle can inherit from a IMovable interface.

An abstract class defines the core identity of a class and there it is used for objects of the same type.

Homogeneity

If various implementations only share method signatures then it is better to use Interfaces.

If various implementations are of the same kind and use common behaviour or status then abstract class is better to use.

Speed

Requires more time to find the actual method in the corresponding classes.

Fast

Adding functionality (Versioning)

If we add a new method to an Interface then we have to track down all the implementations of the interface and define implementation for the new method.

If we add a new method to an abstract class then we have the option of providing default implementation and therefore all the existing code might work properly.

Fields and Constants

No fields can be defined in interfaces

An abstract class can have fields and constrants defined

Monday, May 30, 2011

C# Build Macros for use inside Build Events

Macro

Description

$(ConfigurationName)

The name of the current project configuration, for example, "Debug|Any CPU".

$(OutDir)

Path to the output file directory, relative to the project directory. This resolves to the value for the Output Directory property. It includes the trailing backslash '\'.

$(DevEnvDir)

The installation directory of Visual Studio 2005 (defined with drive and path); includes the trailing backslash '\'.

$(PlatformName)

The name of the currently targeted platform. For example, "AnyCPU".

$(ProjectDir)

The directory of the project (defined with drive and path); includes the trailing backslash '\'.

$(ProjectPath)

The absolute path name of the project (defined with drive, path, base name, and file extension).

$(ProjectName)

The base name of the project.

$(ProjectFileName)

The file name of the project (defined with base name and file extension).

$(ProjectExt)

The file extension of the project. It includes the '.' before the file extension.

$(SolutionDir)

The directory of the solution (defined with drive and path); includes the trailing backslash '\'.

$(SolutionPath)

The absolute path name of the solution (defined with drive, path, base name, and file extension).

$(SolutionName)

The base name of the solution.

$(SolutionFileName)

The file name of the solution (defined with base name and file extension).

$(SolutionExt)

The file extension of the solution. It includes the '.' before the file extension.

$(TargetDir)

The directory of the primary output file for the build (defined with drive and path). It includes the trailing backslash '\'.

$(TargetPath)

The absolute path name of the primary output file for the build (defined with drive, path, base name, and file extension).

$(TargetName)

The base name of the primary output file for the build.

$(TargetFileName)

The file name of the primary output file for the build (defined as base name and file extension).

$(TargetExt)

The file extension of the primary output file for the build. It includes the '.' before the file extension.

Sunday, May 29, 2011

WCF Architecture Diagram

Visual Studio 2010 Certification Paths

Microsoft Certified Technology Specialist (MCTS)

MCTS certifications provide the foundation for Microsoft Certification. These certifications are designed to help validate your skills on the features and functionality of key technologies. You can show your depth of knowledge in one specific technology, earn multiple MCTS certifications to show breadth across different technologies, or build on the MCTS to earn one of our Microsoft Certified Professional Developer (MCPD) certifications.

Your goal

Certification

Requirements

To create Windows-based applications that run on corporate servers or user desktop computers.

MCTS: .NET Framework 4, Windows Applications

Exam 70-511: TS: Windows Applications Development with Microsoft .NET Framework 4

To create web-based applications that run on the ASP.NET platform and are hosted on Internet Information Server.

MCTS: .NET Framework 4, Web Applications

Exam 70-515: TS: Web Applications Development with Microsoft .NET Framework 4

To create applications that communicate with servers or other applications in a connected or disconnected state.

MCTS: .NET Framework 4, Service Communication Applications

Exam 70-513: TS: Windows Communication Foundation Development with Microsoft .NET Framework 4

To create data-driven applications that access data from various sources, such as Microsoft SQL Server, Oracle, Microsoft Office Access, object data sources, XML, or other flat-file sources.

MCTS: .NET Framework 4, Data Access

Exam 70-516: TS: Accessing Data with Microsoft .NET Framework 4

To create rich Internet-based applications by using Microsoft Silverlight.

MCTS: Silverlight 4, Development

Exam 70-506: TS: Silverlight 4, Development

Microsoft Certified Professional Developer (MCPD)

MCPD certifications help validate a comprehensive set of skills that are necessary to design, build, and deploy applications successfully by using Microsoft Visual Studio and the Microsoft .NET Framework. This certification builds on the MCTS certification and is designed to help provide hiring managers with a strong indicator of your potential job success. Candidates for the MCPD typically have two to three years of relevant experience and a commitment to remaining current in best practices and technologies.

Your goal

Certification

Certification prerequisites

Requirements

To design, build, and deploy Windows-based applications by using Visual Studio 2010.

MCPD: Windows Developer 4

MCTS: .NET Framework 4, Windows Applications

and

MCTS: .NET Framework 4, Service Communication Applications

and

MCTS: .NET Framework 4, Data Access

Exam 70-518: PRO: Designing and Developing Windows Applications Using Microsoft .NET Framework 4

To design, build, and deploy web-based applications by using Visual Studio 2010.

MCPD: Web Developer 4

MCTS: .NET Framework 4, Web Applications

and

MCTS: .NET Framework 4, Service Communication Applications

and

MCTS: .NET Framework 4, Data Access

Exam 70-519: PRO: Designing and Developing Web Applications Using Microsoft .NET Framework 4

To design, build, and deploy cloud-based applications that will be hosted on Windows Azure.

MCPD: Windows Azure Developer

MCTS: .NET Framework 4, Service Communication Applications

and

MCTS: .NET Framework 4, Data Access

Exam 70-583: PRO: Designing and Developing Windows Azure Applications*

Oracle Certification Path

SQL Server 2008 Certification Path


Microsoft Certified Technology Specialist -

Your profile

Certification

Exam

Working with SQL Server 2008 and performing database administrator tasks: installing, configuring, and maintaining

MCTS: SQL Server 2008, Implementation and Maintenance

Exam 70-432: TS: Microsoft SQL Server 2008, Installation and Maintenance

Note This exam is also required for the MCITP: Database Administrator 2008 certification.

Working with SQL Server 2008 and writing application code against systems that run SQL Server 2008, writing T-SQL or Microsoft .NET CLR code that runs inside SQL Server 2008, or developing solutions in SQL Server 2008

MCTS: SQL Server 2008, Database Development

Exam 70-433: TS: Microsoft SQL Server 2008, Database Development

Note This exam is also required for the MCITP: Database Developer 2008 certification.

Working with SQL Server 2008 and working with the business intelligence technologies, including Reporting Services, Analysis Services, and Integration Services

MCTS: SQL Server 2008, Business Intelligence Development and Maintenance

Exam 70-448: TS: Microsoft SQL Server 2008, Business Intelligence Development and Maintenance

Note This exam is also required for the MCITP: Business Intelligence Developer 2008 certification.