ole32: Call IRunnableObject_Run and IOleCache_Cache from OleCreate if the render option is specified as draw or format.

This is documented on MSDN and is confirmed by tests.
This commit is contained in:
Robert Shearman 2006-08-31 17:16:28 +01:00 committed by Alexandre Julliard
parent 6da80a8898
commit 53be8cc861

View file

@ -2342,6 +2342,29 @@ HRESULT WINAPI OleCreate(
if (pOleObject)
IOleObject_Release(pOleObject);
if (((renderopt == OLERENDER_DRAW) || (renderopt == OLERENDER_FORMAT)) &&
SUCCEEDED(hres))
{
IRunnableObject *pRunnable;
IOleCache *pOleCache;
hres = IUnknown_QueryInterface(pUnk, &IID_IRunnableObject, (void **)&pRunnable);
if (SUCCEEDED(hres))
{
hres = IRunnableObject_Run(pRunnable, NULL);
IRunnableObject_Release(pRunnable);
}
if (SUCCEEDED(hres))
hres = IUnknown_QueryInterface(pUnk, &IID_IOleCache, (void **)&pOleCache);
if (SUCCEEDED(hres))
{
DWORD dwConnection;
hres = IOleCache_Cache(pOleCache, pFormatEtc, ADVF_PRIMEFIRST, &dwConnection);
IOleCache_Release(pOleCache);
}
}
if (FAILED(hres))
{
IUnknown_Release(pUnk);