November 2006 - Posts

What kind of business Sony is?

Well it seems that Sony is a business mainly providing financial services.All divisions considered, 98% percent of their profit is coming from Sony's japanese consumer bank, so they are a bank also happen to be making playstations. This is funny...

 

More peanut butter, this time at Sony - from arstechnica.com

The One with the Drunken Visual Studio

Arriving home tonight and wanted to a little bit of my hobby pet project, just for relaxing, so I fired up Visual Studio .NET 2005 and saw that the menu items are all duplicated and all the toolbars are duplicated too.

 

I had no idea what happened with it, because this morning everything was fine, when I was doing the morning session on my recreational pet project. I tried about a zillion and two things plus searching the web like crazy, but the one trick that helped at the and was the following:

 

  • Exit Visual Studio
  • Navigate to your %USERPROFILE% in explorer.
  • Go to the following folder %USERPROFILE%\Local Settings\Application Data\Microsoft and rename the Visual Studio folder to something else, like __Visual Studio.
  • Do the same with %USERPROFILE%\\Application Data\Microsoft\ and the Visual Studio folder.
  • Start Visual Studio again.

Let's hope that this can save some times for others!

Reenabling Fast-User Switching and the Welcome Screen on Windows XP

I had an XP machine in a domain and I needed to test something with Fast-User Switching and the Welcome Screen. The steps below are the fruit of an hour worth of swearing and sweating :)

  • First is to remove the machine from the domain. It has to be in a Workgroup.
  • Next go to the Control Panel and Administrative Services, select Services and Enable Fast User Switching Service.
  • The again Control Panel and User Accounts and select Change the way users log on or off.
  • You may receive a message about Offline Files and that it needs to be turned off. Turn it off.
  • You check both the Welcome Screen and the Fast User Switching checkboxes.

Nothing seems to be difficult, I spent 46 minutes with second step (figuring out that I need to start the service) and 4 minutes with the other steps.

Displaying the Property pages for an Encoder Device

Having some problems with presenting the available devices for a Windows Media Encoder session and showing the properties for a specific device. In the Windows Media Encoder SDK you will find the following code on how to display property pages for plug-ins:

    if ( SUCCEEDED( hr ) )
    {
        hr = pPlugin->QueryInterface(IID_ISpecifyPropertyPages,
                                (LPVOID*)&pPages);
    }

    if ( SUCCEEDED( hr ) )
    {
        hr = pPages->GetPages( &uuid );
    }

    // Invoke a dialog box to display.
    if ( SUCCEEDED( hr ) )
    {
        hr = OleCreatePropertyFrame
         (
            m_hWnd,             // You must create the parent window.
          200,                    // Horizontal position for the dialog box.
            200,                // Vertical position for the dialog box.
          CComBSTR("name"),        // String used for the dialog box caption.
          1,                    // Number of pointers passed in pPlugin.
          &pPlugin,                // Pointer to the plug-in.
          uuid.cElems,            // Number of property pages.
          uuid.pElems,            // Array of property page CLSIDs.
          LOCALE_USER_DEFAULT,    // Locale ID for the dialog box.
          0,                    // Reserved.
          NULL                    // Reserved.
          );
    }

 

When you first run this code you will quickly find out that this is not really working. To make it work you need to change this a little bit:

 
    if ( SUCCEEDED( hr ) )
    {
        hr = pPlugin->QueryInterface(IID_ISpecifyPropertyPages,
                                (LPVOID*)&pPages);
    }

    if ( SUCCEEDED( hr ) )
    {
        hr = pPages->GetPages( &uuid );
    }

    IUnknown* pPPObjectUnk = NULL; 

    if(SUCCEEDED(hr))
    {
        hr = pPages->QueryInterface(IID_IUnknown, (LPVOID*)&pPPObjectUnk);
    }

    // Invoke a dialog box to display.
    if ( SUCCEEDED( hr ) )
    {
        hr = OleCreatePropertyFrame
         (
            m_hWnd,             // You must create the parent window.
          200,                    // Horizontal position for the dialog box.
            200,                // Vertical position for the dialog box.
          CComBSTR("name"),        // String used for the dialog box caption.
          1,                    // Number of pointers passed in pPlugin.
          &pPPObjectUnk,                // Pointer to the plug-in.
          uuid.cElems,            // Number of property pages.
          uuid.pElems,            // Array of property page CLSIDs.
          LOCALE_USER_DEFAULT,    // Locale ID for the dialog box.
          0,                    // Reserved.
          NULL                    // Reserved.
          );
    }

    if(pPPObjectUnk)
    {
        pPPObjectUnk->Release();
        pPPObjectUnk = NULL; 
    }