The CLR has been unable to transition from COM context 0xXXXXXX to COM context 0xXXXXXX for 60 seconds. The thread that owns the destination context/apartment is most likely either doing a non pumping wait or processing a very long running operation without pumping Windows messages

Error Message:

β€œThe CLR has been unable to transition from COM context 0x1979d8 to COM context 0x197868 for 60 seconds. The thread that owns the destination context/apartment is most likely either doing a non pumping wait or processing a very long running operation without pumping Windows messages. This situation generally has a negative performance impact and may even lead to the application becoming non responsive or memory usage accumulating continually over time. To avoid this problem, all single threaded apartment (STA) threads should use pumping wait primitives (such as CoWaitForMultipleHandles) and routinely pump messages during long running operations.”

You get this nasty error message and your life is sucked. This happens when you are debugging your application and using breakpoints.

Fix For The Problem:

Go to menu Debug->Exception-> a form appears. Then in Managed Debug Assistants section, just uncheck the ContextSwitchDeadlock.

Note:

If you are not able to see Exception MenuItem in debug menu, then add it from Tools->Customize->Commands.

Advertisements

Windows 7 with 4 versions: Comparison between various versions and editions…

via Windows 7 home page

via Windows 7 home page

Finally windows 7 is here with following 4 versions(as of now):

Comparison shows that you would have really less feature with Starter Edition, you will not be even able to change desktop wallpaper…so sad !

You can see the comparison at:

Microsoft also has 10 reasons to go for windows 7.. Hmmm…

Now we have comparison between various versions of windows:

LoL !!! people are also saying that windows 7 is a subtracted version of vista…. I dont know 😐

ExtJS Tips & Tricks: Making EditorGridPanel (Ext.grid.EditorGridPanel) readonly at runtime in Extjs

I was wondering how i could make EditorGridPanel readonly at runtime. Finally I managed to find out a way to do this. What you have to do is register an handler for grid’s beforeedit event which will return false !!!

say, you need a function which will do this:


//handler function for 'beforeedit' event
function handler_to_makeReadOnly(){return false;}
//function to make EditorGridPanel read only
function MakeEditorGridPanelReadOnly(editorGridPanel)
{
 editorGridPanel.on('beforeedit',handler_to_makeReadOnly,this);
}
//function to make EditorGridPanel normal(editable)
function MakeEditorGridPanelUnReadOnly(editorGridPanel)
{
 editorGridPanel.un('beforeedit',handler_to_makeReadOnly,this);
}

Note: MakeEditorGridPanelUnReadOnly will just remove the effect of MakeEditorGridPanelReadOnly function by unregistering the handler handler_to_makeReadOnly. If grid column models are read only it wont change them, means those columns will still be read only.

If you find any problem just write a comment to reach me.

Modification History:

1. 05 Nov 2009: Made the code block proper.

A very (extremely) simple ASP .Net Hello World example, Just for fun…

I was going through an ASP.Net book, and thought of writing extremely simply Hello World example. This will give an insight of how simple and small page you can write using ASP .Net.

For each example I have given asp .net code and corresponding browser generated code.

Example1

<%@ Page Language="c#"  %>
<%Response.Write("Hello World");>

Brower Source:

Hello World

Example2:

<%@ Page Language="c#" %>
<script runat="server">
void SayHello()
{
Response.Write("Hello World !");
}
</script>
<html>
<body>
<% SayHello(); %>
</body>
</html>

Brower Source:

<html>
<body>
Hello World !
</body>
</html>

Adding macro in to toolbar as tool bar button, creating macro and adding it, with small example

How nice it would be if your favourite macro is available as toolbar button. Its really easy to do. Suppose you have created a macro hello and you want to add it, then just follow these step:

Adding macro to toolbar

  1. Go to menu: tools->Customize… => it will open Customize window.
  2. In Customize window go to ‘Commands’ tab and select ‘Macros’ at left pane, all the macros you have created would be visible at right pane.
  3. Just drag the macro you want to toolbar.
  4. It would automatically create a button with macro name.

Customizing toolbar macro button

  1. Write click on macro toolbar button while Customize window is open.
  2. In this menu you can do all the customization. Changing name, image etc.
  3. You can also assign a shortcut key. Just put &1(if you want alt+1 to a shortcut key) or which ever combination you want.

Office tips and tricks: Creating and adding new toolbar in ms office, a very simple example

You would have seen many toolbars in your office app. Have you ever thought of having toolbar with your own name ;). Yes you can add new tool bar with some really simple step in to your office app(word/outlook/excel etc.). So here we go:
1. Go to menu: tools->Customize… => it will open Customize window.
2. In Customize window go to Toolbars tab and click on “New…” button. It will open a small window here you need to give toolbar name.
3. Your toolbar is ready to add.
4. You can drag buttons from Customize window’s Command tab.
5. For ex. in Command tab select ‘File’ at left pane and drag ‘Open’ in right pane to the newly created toolbar. Its done.

You can also add previously created macro in to this toolbar.

finding information about an IP address on the web

Today i need to find information about an ip address, i got from internet. This thing can also happen when you get any spam or something from an ip and you need information about that ip. ARIN WHOIS Database Search helped me to get more information about ip. following is the URL of it:
http://ws.arin.net/whois/

For example if you want to know whom 216.239.51.99 ip belongs, you can type this ip in left text box on the site and on clicking submit query button you will have complete information.