Need help embedding microsoft word into application via wxActivexContainer

Malcolm MacLeod malcolm.macleod at tshwanedje.com
Fri Feb 1 01:32:00 PST 2008


Hello,

I am trying the following simple snippet to try and embed microsoft word 
via wxActivexContainer

    //Get CLSID for Word.Application...
    CLSID clsid;
    CLSIDFromProgID(L"Word.Application", &clsid);

    //IID for _Application interface
    IID IIDAPPLICATION = { 0x00020970, 0x0000, 0x0000, { 0xC0, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x46 } }; // 
{00020970-0000-0000-C000-000000000046};
        
    //Start an instance of word and get an IDispatch pointing to the 
application instance
    IDispatch *pWordApp;
    CoCreateInstance(clsid,NULL,CLSCTX_LOCAL_SERVER,IIDAPPLICATION,(void 
**)&pWordApp);
    
    wxWindow* pWordPreview = new 
wxActiveXContainer(pTempParent,IIDAPPLICATION,pWordApp);

I am getting an assert on line 960 of activex.cpp

    hret = m_oleObject.QueryInterface(IID_IOleObject, m_ActiveX);
    wxASSERT(SUCCEEDED(hret));

Where the hrets value contains the error E_NOINTERFACE.


Am I doing something wrong here or is this a problem/limitation of the 
wxActivexContainer code?
Either way I would appreciate any assistance as to how I can get this to 
work.


- Malcolm MacLeod




More information about the wx-users mailing list