none
Simple COM appln closes TS Session in win 2008 SP2 32 bit only RRS feed

  • Question

  • Hello,

     

    I have a simple COM application that calls CoCreateInstance() to instantiate Internet Explorer 7 (IE) on Win2008 32 bit. 

    I have installed and configured TS role so that when user connects to this server only this appln launches without desktop,

    now when a user connects IE gets displayed for a short while and the session automatically logs off with error in the event viewer

    1) "Desktop Window Manager was unable to start because a composite theme in not in use"

    2) "Desktop Window Manager has exited with code (0x40010004)

    Any help in solving this is appreciated. 

    Using IE 8 on this OS also results into same error.

    Note - Desktop Experience is disabled. Using windows 2008 SP2 for 32 bit

     

    Thank you

     

     

     

    =========

    Some Background -

    Actually this problem occurs with Citrix XenApp 5 Server on win 2008 32 bit platform only while troubleshooting this problem i ended writing the sample application 

     

    This appln works well on all other platform viz. win2003 win2008R2.

    Read an article that RD session closes if the appln running does not find all the resoruces it needs

    Code 

     

    #include <windows.h>

    #include <exdisp.h>

    #include <stdio.h>

     

    int WINAPI WinMain (HINSTANCE, HINSTANCE, LPSTR, int)

    {

        // Variable for return value.

        HRESULT    hr;

        IWebBrowser2    *m_pRunningIE4;

       // Initialize COM.

        hr = CoInitialize( NULL);

        // Check status.

        if ( FAILED( hr ) )

        {

         exit(1);

        }

     

        hr = CoCreateInstance (CLSID_InternetExplorer, NULL, CLSCTX_SERVER, IID_IWebBrowser2, (void **) &m_pRunningIE4);

     

        if( hr != S_OK)

       {

      printf("FAiled CoCreateInstance");

     exit(2);

      }

     VARIANT_BOOL    vbTRUE = VARIANT_TRUE;

       m_pRunningIE4->put_Visible (vbTRUE);

      m_pRunningIE4->Release();

      Sleep(20*1000);

        CoUninitialize();

        return 0;

    }



    • Edited by dpb_795 Monday, September 12, 2011 12:42 PM
    Monday, September 12, 2011 12:27 PM