none
Are there any Documents describe: Why XCPControl Hostting sample using the ICorRuntimeHost interface?

    Question

  • 1. Are there any Documents describe: Why XCPControl Hostting sample using the ICorRuntimeHost interface?

    2. When host the XCPControl with WTL MDI FORM view, in Debug mode, the first view only show 1st  XCPControl, Why? and How to fix the problem?

    3. When host the XCPControl with WTL MDI FORM view, in Debug mode, if there are N views, and Press Ctrl + F4 to close views, sometimes will cause Big Exception, Why?  and How to fix the problem?

    Unhandled exception at 0x005106c0 in MDIFORM.exe: 0xC0000005: Access violation writing location 0x00000012.

    in m_pUnk4SliverlightAGControl->Release();

    HRESULT CXcpControlHost::DestroyXcpControl()
    {
     HRESULT hr = S_OK;
     if (pxcpControl)
     {
      pxcpControl->Release();
     }
     if (m_pUnk4SliverlightAGControl)
     {
      m_pUnk4SliverlightAGControl->Release();
     }
     return hr;
    }

    4. Why? When change 

    static IUnknown* m_pUnk4SliverlightAGControl = NULL;

    to

    static CComPtr<IUnknown> m_pUnk4SliverlightAGControl = NULL;

    cause  ATLASSERT(p==NULL); exception in statment

    hr = CoCreateInstance(CLSID_XcpControl, NULL, CLSCTX_INPROC_SERVER, IID_IUnknown, (void**)&m_pUnk4SliverlightAGControl);

    Thanks for your answer very much!

     

    Thursday, January 28, 2010 4:22 AM