Esempio n. 1
0
static void IOCS_OnDraw( IOCS *This )
{
    IViewObject *view;

    if ( !This->control || !This->fWindowless )
        return;

    if ( SUCCEEDED( IOleObject_QueryInterface( This->control, &IID_IViewObject, (void**)&view ) ) )
    {
        HDC dc = GetDC( This->hWnd );
        RECTL rect;

        rect.left = This->size.left; rect.top = This->size.top;
        rect.bottom = This->size.bottom; rect.right = This->size.right;

        IViewObject_Draw( view, DVASPECT_CONTENT, ~0, NULL, NULL, 0, dc, &rect, &rect, NULL, 0 );
        IViewObject_Release( view );
        ReleaseDC( This->hWnd, dc );
    }
}
Esempio n. 2
0
/************************************************************************
 *           OleDraw                                   [OLE32.101]
 */
HRESULT OleDraw(IUnknown *pUnk, DWORD dwAspect, HDC hdcDraw, LPCRECT lprcBounds)
{
  RECTL rectl;
  IViewObject *lpViewObj;

  TRACE("pUnk=%p dwAspect=%ld hdDraw=%d lprcBounds=%p\n", pUnk, dwAspect, hdcDraw, lprcBounds); 

  if (!lprcBounds) return E_INVALIDARG;
  if (FAILED(IUnknown_QueryInterface( pUnk, &IID_IViewObject, (LPVOID*)&lpViewObj)))
  {
      return DV_E_NOIVIEWOBJECT;
  }

  rectl.left = lprcBounds->left;
  rectl.top = lprcBounds->top;
  rectl.right = lprcBounds->right;
  rectl.bottom = lprcBounds->bottom;

  return IViewObject_Draw(lpViewObj, dwAspect, -1, 0, 0, 0,
                          hdcDraw, &rectl, 0, 0, 0);
}