The Content of this blog has been moved to my other blog. If not automatically redirected, please click the link below to access the blog:

Have a great day
thanks , krishna kishore koney

64-bit Applications and .Net Platform

All applications built with the 1.0 and 1.1 releases of the .NET Framework are treated as 32-bit applicationsand are always executed under WOW64 on the 32-bit common language runtime (CLR) on a 64-bit operating system. In addition, 32-bit specific applications built with version 2.0 of the .NET Framework would run under WOW64 on 64-bit platforms.

With the introduction of Win64 (64-bit versions of Windows), PE files (EXEs and DLLs) can be marked either as 32-bit OR 64-bit. When a 32-bit EXE is launched on Win64, it runs in "the WOW" (Windows-32 on Windows-64) to present an illusion of a 32-bit operating system to the process. Generally only 32-bit DLLs can be loaded into a 32-bit process, and only 64-bit DLLs can be loaded into a 64-bit process. CLR added 64-bit support in version 2.0. Since people want to write .NET libraries that they could re-use from both 32-bit and 64-bit processes, OS loader was extended to support to enable architecture-neutral ("AnyCPU") PE files.

Managed architecture-neutral DLLs are fairly straight-forward - they can be loaded into either 32-bit or 64-bit processes, and the (32-bit or 64-bit) CLR in the process will do the right thing with them. AnyCPU EXEs are a little more complicated since the OS loader needs to decide how to initialze the process. On 64-bit OSes they are run as 64-bit processes (unless the 'ldr64' master OS switch says otherwise), and on 32-bit OSes they are run as 32-bit processes. In Visual Studio 2008, AnyCPU is the default platform for C# and VB projects. This means that by default("AnyCPU"), applications you compile will run in 64-bit processes on 64-bit OSes and 32-bit processes on 32-bit OSes.

If you have 100% type safe managed code then you really can just copy it to the 64-bit platform and run it successfully under the 64-bit CLR.

But more than likely the managed application will be involved with any or all of the following:

  • Invoking platform APIs via p/invoke
  • Invoking COM objects
  • Making use of unsafe code
  • Using marshaling as a mechanism for sharing information
  • Using serialization as a way of persisting state

Regardless of which of these things your application is doing it is going to be important to do your homework and investigate what your code is doing and what dependencies you have. Once you do this homework you will have to look at your choices to do any or all of the following:

  • Migrate the code with no changes.
  • Make changes to your code to handle 64-bit pointers correctly.
  • Work with other vendors, etc., to provide 64-bit versions of their products.
  • Make changes to your logic to handle marshaling and/or serialization.

Migration considerations

When migrating managed applications that use p/invoke, consider the following items:

  • Availability of a 64-bit version of the DLL
  • Use of data types

The following is a discussion of the different considerations that must be given to making use of COM interoperability where managed code makes COM calls in a 64-bit environment:

  • Availability of a 64-bit version of the DLL
  • Use of data types
  • Type libraries

Find your Application Bitness at runtime

There area also managed library functions to assist you at runtime to determine what environment you are running in.

  • System.IntPtr.Size - to determine if you are running in 32-bit or 64-bit mode
  • System.Reflection.Module.GetPEKind - to programmatically query an .exe or .dll to see if it is meant to run only on a specific platform or under WOW64

Determining the status of an .exe or .dll

Use corflags.exe at the command line to see if it an .exe or .dll is meant to run only on a specific platform or under WOW64. You can also use corflags.exe to change the platform status of an .exe or .dll. See CorFlags Conversion Tool (CorFlags.exe) for more information. A Visual Studio 2005 assembly's CLR header (or COM+ Runtime header) has the Major Run-time Version Number set to 2 and the Minor Run-time Version Number set to 5. In Visual Studio 2003 assemblies, they are 2 and 0, respectively. All applications that have the minor runtime version set to 0 are treated as legacy applications and are always executed under WOW64 on 64-bit machines.

Use the GetPEKind to programmatically query an .exe or .dll to see if it is meant to run only on a specific platform or under WOW64.


64bit .Net -

Migrating 32-bit Managed Code to 64-bit -

AnyCPU Exes are usually more trouble than they're worth -

Windows Services and Windows 7

What are Windows Services?
A service is an integral mechanism built into Microsoft Windows operating systems. You can think of services as “special applications” that run with no regard to the current user context. Services are different from “regular” user applications because you can configure a service to run from the time a system starts up (boots) until it shuts down, without requiring an active user to be present – that is, services can run without having any users logged on.

We like to think about services as running “tasks” for us in the background without interfering with user operations. Services on Windows are responsible for all kinds of background activity that do not involve the user, ranging from the Remote Procedure Call (RPC) service, through Printer Spoolers, to the Network Location Awareness service.

What’s the problem?
Some services may attempt to display user interface dialogs or communicate with user applications. Such functionality is “typical” of Windows XP services, mainly because it is easy to do so. If you happen to own a service that attempts to display some user interface objects, like a dialog box, or tries to communicate with applications you might run into trouble running on Windows 7.

To be more specific, when running on Windows 7, your service may experiences one or more of the following symptoms. The service:

1. Is running, but cannot do what it is supposed to do, and just eats CPU cycles and memory

2.Is running, but other processes can't communicate with it and it cannot communicate with the user, or other applications / services

3. Is trying to communicate with user applications through window messages, but the window messages are not reaching their destination

4.Displays a flashing icon on the taskbar indicating the service wants to interact with the desktop

All the above symptoms point to the conclusion that your service is experiencing Session 0 Isolation of Windows 7 Services, that is, the “physical” separation between services and user applications, but more about that in just a bit. However, the main reason for isolating services from user application is making it harder for malicious software to run with elevated privileges, which enables them to do far more harm than running as standard user as explained in the following section, thus making Windows much more secure operating system.

First, let’s define the two “buckets of issues” your services may experience when running on Windows 7 -

1. The service fails to display a UI or it displays a mitigation UI (or annoying flashing dialog box)

2. Objects shared by services and applications become invisible or inaccessible

Starting with Windows Vista, only services are hosted in Session 0. User applications are isolated from services, and run in subsequent sessions created when users log onto the system: Session 1 for the first logged on user, Session 2 for the second, and so on ...

Entities (applications or services) running in different sessions cannot send each other messages, share UI elements, or share kernel objects without explicitly qualifying them to the global namespace and providing the appropriate access control settings.You can find additional valuable information about this in Impact of Session 0 Isolation on Services and Drivers in Windows Vista(, an article that is equally applicable to Windows 7.

Here are some ideas on how to solve the above mentioned problems:

1. If a service needs to interact with the user by sending a message, use the WTSSendMessage function. It is almost identical in functionality to a MessageBox. This will provide an adequate and simple solution to services that do not require an elaborate UI, and is secure because the displayed message box cannot be used to take control of the underlying service.

2. If your service requires a more elaborate UI, use the CreateProcessAsUser function to create a process in the requesting user’s desktop Note that you will still need to communicate between the newly created process and the original services, which is where the next bullet point kicks in.

3. If two-way interaction is required, use Windows Communication Foundation (WCF), .NET remoting, named pipes, or any other interprocess communication (IPC) mechanism (excluding window messages) to communicate across sessions. WCF and Remoting have a better security enforcement that will prompt the user (assuming UAC not shut-off) to elevate if needed.

4. Ensure that kernel objects meant to be shared across sessions have names prefixed with the Global\ string, indicating that they belong in a session-global namespace.


Windows 7 new APIs and Libraries

Windows 7 new APIs and Libraries :

1. Multi-Touch
2. Ribbon
3. Location
4. Shell Integration

1. Multi-Touch
Touch-based interfaces allow users to interact with applications in a more intuitive way. Windows 7 introduces multi-touch input and manipulation processing through Windows Touch.

For native C++ developers, MFC now supports using a touch-enabled interface. MFC will do much of the heavy lifting: it listens for touch-related messages from Windows and calls out to a number of virtual functions to handle them. Developers merely need to register for touch input, set the gesture configuration, and override these virtual methods as required to touch-enable their application.
WPF 4 includes object model additions for touch interfaces so managed code developers can easily add touch support to their applications as well. Multiple finger input will be exposed through existing and new input events, while new manipulation and inertia events will be exposed for developers to consume.

2. Ribbon
Adding a Ribbon to your application can help organize your commands, tasks, and menus in a friendly way that makes it easier for your customers to find what they’re looking for. Whether your application is written in Win32, MFC, or WPF, new controls and APIs will help you add a Ribbon to your application.

If you write Win32 applications, the Ribbon framework provides a set of APIs for creating a Ribbon for your application. You can find out more about the Windows Ribbon Framework for Win32

The new WPF Ribbon Control will be released out of band around the same time as WPF 4 through the Office UI Licensing site. You can find instructions on downloading the WPF Ribbon (currently in Preview)
here. The WPF Ribbon will feature skins for Windows 7 and Office and all the standard Ribbon features that users are familiar with, including tabs and groups, dynamic resizing, quick access toolbar, application menu, contextual tabs, key tips, and more! The Ribbon will remain available as a separate, standalone assembly.

3. Location
Windows 7 features the Location platform, which makes it easy to write applications that can make use of the user’s location. The Location platform opens the doors to some interesting application scenarios – especially on mobile computers. For example, a location-aware application might use the current location to show the user nearby restaurants or shops, or an instant messaging or email application might tag messages with the sender’s location.

The Location platform provides a way for location devices, such as GPS and WWAN radios, to integrate with Windows and includes an API that applications can use to determine the current location of the computer. Because the Location API exposes its functionality through COM interfaces, C++ programmers and scripting language programmers alike can take advantage of it. The Windows 7 SDK includes samples and documentation to help you build location-aware applications. Find out more about the COM Location API on

In addition to the COM Location API, .NET Framework 4 will include built-in managed APIs for location, making it easy for .NET applications to take advantage of Windows 7’s location capabilities.

4. Shell Integration
Windows 7’s Shell enhancements empower application authors to provide a richer integrated user experience. Jump Lists provide access to contextual startup tasks and files available to the applications. For instance, right-clicking on the Outlook icon will show the mail messages you’ve recently opened in the Jump List:

Windows® API Code Pack - API to access Windows 7 features

Windows® API Code Pack for Microsoft® .NET Framework provides a source code library that can be used to access some new Windows 7 features (and some existing features of older versions of Windows operating system) from managed code. These Windows features are not available to developers today in the .NET Framework. The individual features supported in this version (v1.0) of the library are:

Windows 7 Taskbar Jump Lists, Icon Overlay, Progress Bar, Tabbed Thumbnails, and Thumbnail Toolbars.

Windows 7 Libraries, Known Folders, non-file system containers.

Windows Shell Search API support, a hierarchy of Shell Namespace entities, and Drag and Drop functionality for Shell Objects.

Explorer Browser Control.

Shell property system.

Windows Vista and Windows 7 Common File Dialogs, including custom controls.

Windows Vista and Windows 7 Task Dialogs.

Direct3D 11.0, Direct3D 10.1/10.0, DXGI 1.0/1.1, Direct2D 1.0, DirectWrite, Windows Imaging Component (WIC) APIs. (DirectWrite and WIC have partial support)

Sensor Platform APIs

Extended Linguistic Services APIs

Power Management APIs

Application Restart and Recovery APIs

Network List Manager APIs

Command Link control and System defined Shell icons.What’s New in this update (v1.0):

The new features added in this update of code pack are:

Shell Search API support.

Drag and Drop functionality for Shell objects.

Support for Direct3D and Direct2D interoperability.

Support for Typography and Font enumeration DirectWrite APIs.

Somasegar’s blog -

Windows 7 Taskbar and Libraries .NET Interop Sample Library -

Tim Sneath's Windows 7 Blog -

Windows Team Blog -

Windows Developer's site -

Windows 7 Developer Guide -

Windows® API Code Pack for Microsoft® .NET Framework -

Arun Kishan MSDN Channel 9's Windows' low level architecture -

Mark Russinovich's MSDN Channel 9's discussion of Windows 7 kernel-level stuff -

WPF vs Windows Forms vs MFC

WPF vs Windows Forms

WPF is not just for applications which simply require “eye candy.” That is the most common and frustrating misperception about WPF which I’ve encountered. Sure, WPF has a lot of support for flashy visuals and animations. But that’s not all it’s good for. If you’ve worked with WPF for any substantial period of time you are probably well aware of this fact, so I won’t keep harping on the issue.

The true power of WPF resides in the data binding mechanism and the way it shares resources across the application. On extra benefit that comes from the learning curve is that who learn how to decouple logic from UI. It’s not because of a pattern, but because of the data binding mechanism. Truly an application will last longer, when the UI can be changed without producing problems to the logic. Use the templates right and you can change a piece of UI code that reflects to the entire application. And don’t get me started about the usage of Control Templates.

WPF is an especially great platform to use if your applications involve various media types.

For example,

1. If you need to incorporate video, or documents, or 3D content, or animated transitions between a sequence of images, or a combination of any of the above.

2. WPF is also great if you need to create a skinned user interface

3. If you need to bind to XML data

4. Dynamically load portions of a user interface from a Web service

5. Want to create a desktop application with a Web-like navigation style.

WinForms definitely still has a role to play, despite the fact that WPF has hit the scene. If you are building applications with no need for the extensive modern functionality in WPF, then there is no compelling reason to leave behind a time-tested developer-approved platform. WinForms certainly has more 3rd party controls available, online resources, developer communities, etc. than WPF currently does. It’s much easier to find WinForms developers than WPF developers. Also, WinForms currently has a much better design-time experience in Visual Studio than WPF. That fact alone is a very compelling reason to stick with WinForms for a while.

Lastly, don’t forget that it is possible to use WPF controls in a WinForms app, and WinForms controls in a WPF app. If you have a substantial investment in a WinForms code-base, but want to use some aspect(s) of WPF, you can leverage the interop support to make that possible. Just be sure to read up on the limitations involved with WinForms-WPF interop before getting too far down that path.

WPF Positives & Nagatives

+ Powerfull styling and skinning structure
+ Easy to create an own Look and Feel
+ Does support Windows Forms
+ The future technology for developing Vista Applications
+ The ability to reuse existing code
+ Highly advanced databinding possible
+ Declarative vs procedural code
+ Vector Graphics simplifes painting Operations
+ 3D
+ Animations
+ WPF Everywhere Idea (Silverlight and Microframework)
- Requires .NET Framework 3.0
- Compared to Windows Forms, still in development fase
- Requires Dx9 compatible vidcard for advanced graphics

Windows Forms Positives & Nagatives
+ Extensive documentation to be found on the internet
+ Plenty of examples
+ Does support WPF
- How long will this be supported? (I've read somewhere that Microsoft is only developing WPF now, only maintanance for Winforms)
- Design your own look and feel in a application is a lot of work.


Windows Forms vs MFC

If you are accustomed to MFC, you might be used to creating certain types of applications that are not yet explicitly supported in Windows Forms. Windows Forms applications are equivalent to MFC dialog applications. However, they do not provide the infrastructure to directly support other MFC application types like OLE document server/container, ActiveX documents, the Document/View support for single-document interface (SDI), multiple-document interface (MDI), and multiple top-level interface (MTI). You can write your own logic to create these applications.


Microsoft Architecture Journal online

Learn Architecture from Microsoft Architecture Journals -

Role of an Architect - (pdf version)

Strategies for Design - (pdf version)

Web Architecture - (pdf version)

Mobile Architecture - (pdf version)

Data by Design - (pdf version)

Distributed Computing - (pdf version)

Software plus Services - (pdf version)

SOA Today & Tomorrow - (pdf version)

Architecture in Turbulent Times - (pdf version)

Identity and Access Management - (pdf version)

“10/10” Technique - A way of gathering 'feedback and ideas for improvement'

“10/10” technique is a simple, yet effective way of gathering 'feedback and ideas for improvement'

Although it can be used for self-improvement in a lot of ways, we use it for leadership development as follow-up to a 360 degree assessment.

First, the manager identifies something they want to improve – say leading a meeting, delegating, listening, or conducting a one on one. Although not as effective, it could even be as general as “leadership”.

Then, at the end of a one on one, or whenever the opportunity presents itself (it only takes about 10 minutes), the manager asks the question: “On a scale of 1-10, how would you rate my delegation skills?” Usually the answer is not a perfect 10, because the manager has already had it pointed out on their 360 assessment. So if it’s anything less than 10, the managers ask the follow-up question: “What would I need to do for you to rate me a 10?

It works so well because it gives the manager very specific ideas for improvement, in terms of what’s important to the other person. It opens up dialog in a non-threatening way, builds trust, and creates a win-win developmental partnership.

The 10/10 technique is very versatile – it can also be used with your peers, manager, partners, customers, suppliers. “So tell me buddy, on a scale of 1-10, how would you rate my mentoring skills?”


Dan McCarthy blog -

The traits of global leader of the future

The traits of global leader of the future:

· Ethics

· Honesty

· Transparency

· Integrity

· Humility

· Respect

· Flexibility

· Collaboration

So what does it mean to show RESPECT as a leader?

R = Relationships. Have you taken the time to cultivate a relationship, based on mutual respect and support?

E = Everyone counts, no matter who they are, at any level in the organization.

S = Support your employees.

P = Please and thank-you.

E = Encourage every employee to grow and develop, in order to reach their full potential.

C = Care. That’s right, care about your employees (some would say love them, although that sounds a bit extreme for me).

T = Treat people how they want to be treated (the platinum rule), not how you want to be treated (the golden rule).


John Spence Post in Dan McCarthy Blog

Dan McCarthy's Blog -

Visualize Success - The Key to Success

A goal envisioned is a goal half completed. Creating a vision before starting out on your journey creates a real destination in your mind, which is infinitely preferable to just wandering off in the general direction of whatever it is you want and hoping you end up somewhere acceptable. The stronger and more realistically detailed you make your visualizations, the better chance you have of succeeding.

Play a movie in your head of you achieving your big goal. Sounds easy, Here are the steps you have to take -

1. Know exactly what you want. A defined, very specific goal. Not "start a company" but "open a dog-grooming business in Portland."

2. Know exactly what reaching the goal will look like the steps leading up to the achievement. If your goal is to win a Nobel Prize, you need to imagine yourself making the great discovery.

3. Organize your life around your goal so that you can play your movie in your head before you go to bed and immediately when you get up. This means you need to get to some sort of meditative point where you can sit still, for maybe ten minutes, while you play your movie in your head.

4. Find optimism. Lots of it. Because you have to believe in yourself enough that you will actually do this exercise every day until you reach your dream.

A Scenario:

Health, success, money, promotion and possessions can be gained through creative visualization. It does not mean that everything will change overnight. Mental work is necessary. A change of attitude towards life is a necessity. You need an open mind, concentration, the ability to visualize, and a lot of enthusiasm and persistence.

Suppose you need five thousand dollars. Build in your imagination a mental image of a check for this amount, made out in your name. See it clearly as if it is really there, but do not visualize the name of the bank, or who signed it.

Imagine yourself holding the check. Pass your fingers over it to feel its texture. A clear cut mental image, involving all the five senses, and soaked with desire and faith is a power that influences your actions and imprints itself on the creative power of the universe.

Arouse in yourself feelings of happiness and satisfaction that you have received this check. Do not think who gave it to you, or why it was drawn in your name.

Imagining that you have already received the check is very important. This way the subconscious mind accepts it as a fact and does not arouse hindrances. It is also important to feel convinced that it came in a harmonious way, and that all people involved were and are benefited by it.

The next step is to see yourself depositing the check in your account at the bank. You may also visualize the entry for five thousand dollars in your bank's statement.

What will happen? The money will appear in your life. It may come through various channels. It may come as a present, winning at the lottery, a promotion at work, a new job, a good investment in shares or stocks, or through other channels. Results may be immediate or delayed.


Penelope Trunk's Blog(

Career Advices

1. Job/work isn't just about getting a paycheck; Job is a a way to connect with the world.

2. The best way to ensure you'll always be in demand is to become a specialist. Specializing is a way to differentiate yourself in a crowd. Generalizing often looks weak, lacking direction or commitment. "Generalizing could be useful as a hedging strategy if you are in a volatile industry." But if you see yourself going to the top, you need to sell yourself as a specialist, not someone hedging for a darker day.

3. You need to be an adult, and realize that adults make big decisions. Things don't just happen to you. You have power to decide what your life will be like.

4. Career decisions are not decisions about "what do I love most?" Career decisions are about what kind of life do I want to set up for myself?

5. Relationships make your life great, not jobs. But a job can ruin your life – make you feel out of control in terms of your time or your ability to accomplish goals – but no job will make your life complete. It's a myth mostly propagated by people who tell you to do what you love. Doing what you love will make you feel fulfilled. But you don't need to get paid for it.

6. The big factors in determining happiness levels are satisfaction with your job and social relationships. And in case you found yourself slipping back to thoughts of salary, according to a study, "How much pleasure people get from their job is independent of how much it pays".

7. Manage your image by telling good stories. The way you talk about yourself is very powerful. Whether or not you are conscious of it, the way you tell stories of your life frames how people see you, and how you see yourself. Acting and leading are both about establishing a relationship with an audience and making them believe in you.


Penelope Trunk's Blogs(