Home COM GDI+ WebBrowser Data Access

IOleInPlaceFrame Interface

 

IID_IOleInPlaceFrame

{00000116-0000-0000-C000-000000000046}

 

 

The IOleInPlaceFrame interface controls the container's top-level frame window. This control involves allowing the container to insert its menu group into the composite menu, install the composite menu into the appropriate window frame, and remove the container's menu elements from the composite menu. It sets and displays status text relevant to the in-place object. It also enables or disables the frame's modeless dialog boxes, and translates accelerator keystrokes intended for the container's frame.

 

This interface is used by object applications to control the display and placement of composite menus, keystroke accelerator translation, context-sensitive help mode, and modeless dialog boxes.

 

 

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.

IOleInPlaceUIWindow Methods

Description

GetBorder

Specifies a RECT structure for toolbars and controls.

RequestBorderSpace

Determines if tools can be installed around object's window frame.

SetBorderSpace

Allocates space for the border.

SetActiveObject

Provides for direct communication between the object and each document and frame window.

IOleInPlaceFrame Methods

Description

InsertMenus

Allows container to insert menus.

SetMenu

Adds a composite menu to window frame.

RemoveMenus

Removes a container's menu elements.

SetStatusText

Sets and displays status text about.

EnableModeless

Enables or disables modeless dialog boxes.

TranslateAccelerator

Translates keystrokes.

 

InsertMenus

 

FUNCTION IOleInPlaceFrame_InsertMenus ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL hMenuShared AS DWORD _

, BYVAL lpMenuWidths AS OLEMENUGROUPWIDTHS _

  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[9] USING IOleInPlaceFrame_InsertMenus (pthis, hMenuShared, lpMenuWidths) TO HRESULT
  FUNCTION = HRESULT


END FUNCTION

 

 

SetMenu

 

FUNCTION IOleInPlaceFrame_SetMenu ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL hMenuShared AS DWORD _

, BYVAL holemenu AS DWORD _

, BYVAL hwndActiveObject AS DWORD _

  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[10] USING IOleInPlaceFrame_SetMenu (pthis, hMenuShared, holemenu,
hwndActiveObject) TO HRESULT
  FUNCTION = HRESULT


END FUNCTION

 

 

RemoveMenus

 

FUNCTION IOleInPlaceFrame_RemoveMenus ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL hMenuShared AS DWORD _

  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[11] USING IOleInPlaceFrame_RemoveMenus (pthis, hMenuShared) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

SetStatusText

 

FUNCTION IOleInPlaceFrame_SetStatusText ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL strStatusText AS STRING _

  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[12] USING

  strStatusText = UCODE$(strStatusText) & $NUL

  Proto_IOleInPlaceFrame_SetStatusText (pthis, strStatusText) TO HRESULT
  FUNCTION = HRESULT


END FUNCTION

 

 

EnableModeless

 

FUNCTION IOleInPlaceFrame_EnableModeless ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL fEnable AS LONG _

  ) AS LONG

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

END FUNCTION

 

 

TranslateAccelerator

 

FUNCTION IOleInPlaceFrame_TranslateAccelerator ( _

  BYVAL pthis AS DWORD PTR _

, BYREF lpmsg AS tagMsg _

, BYVAL wID AS WORD _

  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[14] USING IOleInPlaceFrame_TranslateAccelerator (pthis, lpmsg, wID) TO HRESULT
  FUNCTION = HRESULT


END FUNCTION

 

 

IOleInPlaceFrame interface implementation

 


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

' ****************************************************************************************
' IOleInPlaceFrame interface
' ****************************************************************************************
TYPE IOleInPlaceFrameVtbl
   ' 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
   ' IOleInPlaceUIWindow members
   pGetBorder               AS DWORD          ' // GetBorder method
   pRequestBorderSpace      AS DWORD          ' // RequestBorderSpace method
   pSetBorderSpace          AS DWORD          ' // SetBorderSpace method
   pSetActiveObject         AS DWORD          ' // SetActiveObject method
   ' IOleInPlaceFrame members
   pInsertMenus             AS DWORD          ' // InsertMenus method
   pSetMenu                 AS DWORD          ' // SetMenu method
   pRemoveMenus             AS DWORD          ' // RemoveMenus method
   pEnableModeless          AS DWORD          ' // EnableModeless method
   pTranslateAccelerator    AS DWORD          ' // TranslateAccelerator method
   ' Custom data
   pVtblAddr                AS DWORD          ' // Address of the virtual table
   cRef                     AS DWORD          ' // Reference count
END TYPE
' ****************************************************************************************

' ****************************************************************************************
' Builds the IOleInPlaceFrame Virtual Table
' Returns a cookie that is a pointer to a IOleInPlaceFrameVtbl structure.
' ****************************************************************************************
FUNCTION IOleInPlaceFrame_BuildVtbl () AS DWORD

   LOCAL pVtbl AS IOleInPlaceFrameVtbl PTR
   LOCAL pUnk AS IOleInPlaceFrameVtbl PTR

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

   @pVtbl.pQueryInterface          = CODEPTR(IOleInPlaceFrame_QueryInterface)
   @pVtbl.pAddRef                  = CODEPTR(IOleInPlaceFrame_AddRef)
   @pVtbl.pRelease                 = CODEPTR(IOleInPlaceFrame_Release)

   @pVtbl.pGetWindow               = CODEPTR(IOleInPlaceFrame_GetWindow)
   @pVtbl.pContextSensitiveHelp    = CODEPTR(IOleInPlaceFrame_ContextSensitiveHelp)
   @pVtbl.pGetBorder               = CODEPTR(IOleInPlaceFrame_GetBorder)
   @pVtbl.pRequestBorderSpace      = CODEPTR(IOleInPlaceFrame_RequestBorderSpace)
   @pVtbl.pSetBorderSpace          = CODEPTR(IOleInPlaceFrame_SetBorderSpace)
   @pVtbl.pSetActiveObject         = CODEPTR(IOleInPlaceFrame_SetActiveObject)
   @pVtbl.pInsertMenus             = CODEPTR(IOleInPlaceFrame_InsertMenus)
   @pVtbl.pSetMenu                 = CODEPTR(IOleInPlaceFrame_SetMenu)
   @pVtbl.pRemoveMenus             = CODEPTR(IOleInPlaceFrame_RemoveMenus)
   @pVtbl.pEnableModeless          = CODEPTR(IOleInPlaceFrame_EnableModeless)
   @pVtbl.pTranslateAccelerator    = CODEPTR(IOleInPlaceFrame_TranslateAccelerator)

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

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

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

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

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

' ****************************************************************************************
' IOleInPlaceFrame_Release method
' Releases our class if there is only a reference to him and decrements the reference counter.
' ****************************************************************************************
FUNCTION IOleInPlaceFrame_Release (BYVAL pCookie AS IOleInPlaceFrameVtbl 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 IOleInPlaceFrame_GetWindow (BYVAL pCookie AS IOleInPlaceFrameVtbl PTR, BYREF phwnd AS DWORD) AS LONG
   ' Put your code here
END FUNCTION
' ****************************************************************************************

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

' ****************************************************************************************
' Specifies a RECT structure for toolbars and controls.
' ****************************************************************************************
FUNCTION IOleInPlaceFrame_GetBorder (BYVAL pCookie AS IOleInPlaceFrameVtbl PTR, BYREF lprectBorder AS RECT) AS LONG
   ' Put your code here
END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' Determines if tools can be installed around object's window frame.
' ****************************************************************************************
FUNCTION IOleInPlaceFrame_RequestBorderSpace (BYVAL pCookie AS IOleInPlaceFrameVtbl PTR, BYREF pborderwidths AS RECT) AS LONG
   ' Put your code here
END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' Allocates space for the border.
' ****************************************************************************************
FUNCTION IOleInPlaceFrame_SetBorderSpace (BYVAL pCookie AS IOleInPlaceFrameVtbl PTR, BYREF pborderwidths AS RECT) AS LONG
   ' Put your code here
END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' Provides for direct communication between the object and each document and frame window.
' ****************************************************************************************
FUNCTION IOleInPlaceFrame_SetActiveObject (BYVAL pCookie AS IOleInPlaceFrameVtbl PTR, BYVAL pActiveObject AS DWORD, BYVAL pszObjName AS STRING) AS LONG
   ' Put your code here
END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' Allows container to insert menus.
' ****************************************************************************************
FUNCTION IOleInPlaceFrame_InsertMenus (BYVAL pCookie AS IOleInPlaceFrameVtbl PTR, BYVAL hMenuShared AS DWORD, BYVAL lpMenuWidths AS OLEMENUGROUPWIDTHS) AS LONG
   ' Put your code here
END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' Adds a composite menu to window frame.
' ****************************************************************************************
FUNCTION IOleInPlaceFrame_SetMenu (BYVAL pCookie AS IOleInPlaceFrameVtbl PTR, BYVAL hMenuShared AS DWORD, BYVAL holemenu AS DWORD, BYVAL hwndActiveObject AS DWORD) AS LONG
   ' Put your code here
END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' Removes a container's menu elements.
' ****************************************************************************************
FUNCTION IOleInPlaceFrame_RemoveMenus (BYVAL pCookie AS IOleInPlaceFrameVtbl PTR, BYVAL hMenuShared AS DWORD) AS LONG
   ' Put your code here
END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' Sets and displays status text about.
' ****************************************************************************************
FUNCTION IOleInPlaceFrame_SetStatusText (BYVAL pCookie AS IOleInPlaceFrameVtbl PTR, BYVAL strStatusText AS DWORD) AS LONG
   ' Put your code here
END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' Enables or disables modeless dialog boxes.
' ****************************************************************************************
FUNCTION IOleInPlaceFrame_EnableModeless (BYVAL pCookie AS IOleInPlaceFrameVtbl PTR, BYVAL fEnable AS LONG) AS LONG
   ' Put your code here
END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' Translates keystrokes.
' ****************************************************************************************
FUNCTION IOleInPlaceFrame_TranslateAccelerator (BYVAL pCookie AS IOleInPlaceFrameVtbl PTR, BYREF lpmsg AS tagMsg, BYVAL wID AS WORD) AS LONG
   ' Put your code here
END FUNCTION
' ****************************************************************************************
 

 

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