From 53be8cc861461e5635854befdf1e4eb74f92add1 Mon Sep 17 00:00:00 2001 From: Robert Shearman Date: Thu, 31 Aug 2006 17:16:28 +0100 Subject: [PATCH] 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. --- dlls/ole32/ole2.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/dlls/ole32/ole2.c b/dlls/ole32/ole2.c index 4d7c17b2fb5..e2d9d9d565a 100644 --- a/dlls/ole32/ole2.c +++ b/dlls/ole32/ole2.c @@ -2341,7 +2341,30 @@ 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);