Home COM GDI+ WebBrowser Data Access

IOleInPlaceActiveObject Interface

 

IID_IOleInPlaceActiveObject

{00000117-0000-0000-C000-000000000046}

 

 

The IOleInPlaceActiveObject interface provides a direct channel of communication between an in-place object and the associated application's outer-most frame window and the document window within the application that contains the embedded object. The communication involves the translation of messages, the state of the frame window (activated or deactivated), and the state of the document window (activated or deactivated). Also, it informs the object when it needs to resize its borders, and manages modeless dialog boxes.

 

These methods are used by the in-place object's top-level container to manipulate objects while they are active.

 

 

Methods in VTable order

IUnknown Methods

Description

QueryInterface

Returns pointers to supported interfaces.

AddRef

Increments reference count.

Release

Decrements reference count.

IOleWindow Methods

Description

GetWindow

Gets a window handle.

ContextSensitiveHelp

Controls enabling of context-sensitive help.

IOleInPlaceActiveObject Methods

Description

TranslateAccelerator

Translates messages.

OnFrameWindowActivate

State of container's top-level frame.

OnDocWindowActivate

State of container document window.

ResizeBorder

Alert object of need to resize border space.

EnableModeless

Enable or disable modeless dialog boxes.

 

TranslateAccelerator

 

FUNCTION IOleInPlaceActiveObject_TranslateAccelerator ( _

  BYVAL pthis AS DWORD PTR _

, BYREF lpmsg AS tagMsg _

  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[5] USING IOleInPlaceActiveObject_TranslateAccelerator (pthis, lpmsg) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

OnFrameWindowActivate

 

FUNCTION IOleInPlaceActiveObject_OnFrameWindowActivate ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL fActivate AS LONG _

  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[6] USING IOleInPlaceActiveObject_OnFrameWindowActivate (pthis, fActivate) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

OnDocWindowActivate

 

FUNCTION IOleInPlaceActiveObject_OnDocWindowActivate ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL fActivate AS LONG _

  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[7] USING IOleInPlaceActiveObject_OnFrameWindowActivate (pthis, fActivate) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

ResizeBorder

 

FUNCTION IOleInPlaceActiveObject_ResizeBorder ( _

  BYVAL pthis AS DWORD PTR _

, BYREF prcBorder AS RECT _

, BYVAL pUIWindow AS DWORD _

, BYVAL fFrameWindow AS LONG _

  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[8] USING IOleInPlaceActiveObject_ResizeBorder (pthis, prcBorder, pUIWindow, fFrameWindow) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

EnableModeless

 

FUNCTION IOleInPlaceActiveObject_EnableModeless ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL fEnable AS LONG _

  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[9] USING IOleInPlaceActiveObject_EnableModeless (pthis, fEnable) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

IOleInPlaceActiveObject interface implementation

 


$IID_IOLeInPlaceActiveObject = GUID$("{00000117-0000-0000-C000-000000000046}")

' ****************************************************************************************
' IOLeInPlaceActiveObject interface
' ****************************************************************************************
TYPE IOLeInPlaceActiveObjectVtbl
   ' IUnknown methods
   pQueryInterface          AS DWORD          ' // QueryInterface method
   pAddRef                  AS DWORD          ' // AddRef method
   pRelease                 AS DWORD          ' // Release method
   ' IOleWindow  members
   pGetWindow               AS DWORD          ' // GetWindow method
   pContextSensitiveHelp    AS DWORD          ' // GetWindow method
   ' IOLeInPlaceActiveObject members
   pTranslateAccelerator    AS DWORD          ' // TranslateAccelerator method
   pOnFrameWindowActivate   AS DWORD          ' // OnFrameWindowActivate method
   pOnDocWindowActivate     AS DWORD          ' // OnDocWindowActivate method
   pResizeBorder            AS DWORD          ' // ResizeBorder method
   pEnableModeless          AS DWORD          ' // EnableModeless method
   ' Custom data
   pVtblAddr                AS DWORD          ' // Address of the virtual table
   cRef                     AS DWORD          ' // Reference count
END TYPE
' ****************************************************************************************

' ****************************************************************************************
' Builds the IOLeInPlaceActiveObject Virtual Table
' Returns a cookie that is a pointer to a IOLeInPlaceActiveObjectVtbl structure.
' ****************************************************************************************
FUNCTION IOLeInPlaceActiveObject_BuildVtbl () AS DWORD

   LOCAL pVtbl AS IOLeInPlaceActiveObjectVtbl PTR
   LOCAL pUnk AS IOLeInPlaceActiveObjectVtbl PTR

   pVtbl = HeapAlloc(GetProcessHeap(), %HEAP_ZERO_MEMORY, SIZEOF(@pVtbl))
   IF pVtbl = 0 THEN EXIT FUNCTION

   @pVtbl.pQueryInterface          = CODEPTR(IOLeInPlaceActiveObject_QueryInterface)
   @pVtbl.pAddRef                  = CODEPTR(IOLeInPlaceActiveObject_AddRef)
   @pVtbl.pRelease                 = CODEPTR(IOLeInPlaceActiveObject_Release)

   @pVtbl.pGetWindow               = CODEPTR(IOLeInPlaceActiveObject_GetWindow)
   @pVtbl.pContextSensitiveHelp    = CODEPTR(IOLeInPlaceActiveObject_ContextSensitiveHelp)
   @pVtbl.pTranslateAccelerator    = CODEPTR(IOLeInPlaceActiveObject_TranslateAccelerator)
   @pVtbl.pOnFrameWindowActivate   = CODEPTR(IOLeInPlaceActiveObject_OnFrameWindowActivate)
   @pVtbl.pOnDocWindowActivate     = CODEPTR(IOLeInPlaceActiveObject_OnDocWindowActivate)
   @pVtbl.pResizeBorder            = CODEPTR(IOLeInPlaceActiveObject_ResizeBorder)
   @pVtbl.pEnableModeless          = CODEPTR(IOLeInPlaceActiveObject_EnableModeless)

   @pVtbl.pVtblAddr                = pVtbl
   @pVtbl.cRef                     = 1

   pUnk = VARPTR(@pVtbl.pVtblAddr)
   FUNCTION = pUnk

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' IOLeInPlaceActiveObject_QueryInterface method
' Returns the IUnknown of our class and increments the reference counter.
' ****************************************************************************************
FUNCTION IOLeInPlaceActiveObject_QueryInterface (BYVAL pCookie AS IOLeInPlaceActiveObjectVtbl PTR, BYREF riid AS GUID, BYREF ppvObj AS DWORD) AS LONG
   IF riid = $IID_IOLeInPlaceActiveObject THEN
      ppvObj = pCookie
      INCR @@pCookie.cRef
      FUNCTION = %S_OK
   ELSE
      FUNCTION = %E_NOINTERFACE
   END IF
END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' IOLeInPlaceActiveObject_AddRef method
' Increments the reference counter.
' ****************************************************************************************
FUNCTION IOLeInPlaceActiveObject_AddRef (BYVAL pCookie AS IOLeInPlaceActiveObjectVtbl PTR) AS DWORD
   INCR @@pCookie.cRef
   FUNCTION = @@pCookie.cRef
END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' IOLeInPlaceActiveObject_Release method
' Releases our class if there is only a reference to him and decrements the reference counter.
' ****************************************************************************************
FUNCTION IOLeInPlaceActiveObject_Release (BYVAL pCookie AS IOLeInPlaceActiveObjectVtbl PTR) AS DWORD
   DECR @@pCookie.cRef
   FUNCTION = @@pCookie.cRef
   IF @@pCookie.cRef = 0 THEN
      IF ISTRUE @@pCookie.pVtblAddr THEN
         HeapFree(GetProcessHeap(), 0, BYVAL @@pCookie.pVtblAddr)
      END IF
   END IF
END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' Gets a window handle.
' ****************************************************************************************
FUNCTION IOLeInPlaceActiveObject_GetWindow (BYVAL pCookie AS IOLeInPlaceActiveObjectVtbl PTR, BYREF phwnd AS DWORD) AS LONG
   ' Put your code here
END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' Controls enabling of context-sensitive help.
' ****************************************************************************************
FUNCTION IOLeInPlaceActiveObject_ContextSensitiveHelp (BYVAL pCookie AS IOLeInPlaceActiveObjectVtbl PTR, BYVAL fEnterMode AS LONG) AS LONG
   ' Put your code here
END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' Translates messages.
' ****************************************************************************************
FUNCTION IOLeInPlaceActiveObject_TranslateAccelerator (BYVAL pCookie AS IOLeInPlaceActiveObjectVtbl PTR, BYREF lpmsg AS tagMsg) AS LONG
   ' Put your code here
END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' State of container's top-level frame.
' ****************************************************************************************
FUNCTION IOLeInPlaceActiveObject_OnFrameWindowActivate (BYVAL pCookie AS IOLeInPlaceActiveObjectVtbl PTR, BYVAL fActivate AS LONG) AS LONG
   ' Put your code here
END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' State of container document window.
' ****************************************************************************************
FUNCTION IOLeInPlaceActiveObject_OnDocWindowActivate (BYVAL pCookie AS IOLeInPlaceActiveObjectVtbl PTR, BYVAL fActivate AS LONG) AS LONG
   ' Put your code here
END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' Alert object of need to resize border space.
' ****************************************************************************************
FUNCTION IOLeInPlaceActiveObject_ResizeBorder (BYVAL pCookie AS IOLeInPlaceActiveObjectVtbl PTR, BYREF prcBorder AS RECT, BYVAL pUIWindow AS DWORD, BYVAL fFrameWindow AS LONG) AS LONG
   ' Put your code here
END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' Enable or disable modeless dialog boxes.
' ****************************************************************************************
FUNCTION IOLeInPlaceActiveObject_EnableModeless (BYVAL pCookie AS IOLeInPlaceActiveObjectVtbl PTR, BYVAL fEnable AS LONG) AS LONG
   ' Put your code here
END FUNCTION
' ****************************************************************************************
 

 

Page last updated on Monday, 03 April 2006 20:31:28 +0200