|
|
|
IOleInPlaceObject Interface |
|
IID_IOleInPlaceObject |
{00000113-0000-0000-C000-000000000046} |
|
The IOleInPlaceObject interface manages the activation and deactivation of in-place objects, and determines how much of the in-place object should be visible.
You can obtain a pointer to IOleInPlaceObject by calling QueryInterface on IOleObject.
Used by an object's immediate container to activate or deactivate the object.
|
|
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. |
|
IOleInPlaceObject Methods |
Description |
|
InPlaceDeactivate |
Deactivate active in-place object. |
|
UIDeactivate |
Deactivate and remove UI of active object. |
|
SetObjectRects |
Portion of in-place object to be visible. |
|
ReactivateAndUndo |
Reactivate previously deactivated object. |
|
InPlaceDeactivate |
|
FUNCTION IOleInPlaceObject_InPlaceDeactivate ( _ BYVAL pthis AS DWORD PTR _
) AS
LONG
|
|
UIDeactivate |
|
FUNCTION IOleInPlaceObject_UIDeactivate ( _ BYVAL pthis AS DWORD PTR _
) AS
LONG
|
|
SetObjectRects |
|
FUNCTION IOleInPlaceObject_SetObjectRects ( _ BYVAL pthis AS DWORD PTR _ , BYREF lprcPosRect AS RECT _ , BYREF lprcClipRect AS RECT _
)
AS LONG
|
|
ReactivateAndUndo |
|
FUNCTION IOleInPlaceObject_ReactivateAndUndo ( _ BYVAL pthis AS DWORD PTR _
) AS
LONG
|
|
IOleInPlaceObject interface implementation |
$IID_IOleInPlaceObject = GUID$("{00000113-0000-0000-C000-000000000046}")
' ****************************************************************************************
' IOleInPlaceObject interface
' ****************************************************************************************
TYPE IOleInPlaceObjectVtbl
' 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
' IOleInPlaceObject members
pInPlaceDeactivate AS DWORD ' // InPlaceDeactivate method
pUIDeactivate AS DWORD ' // UIDeactivate method
pSetObjectRects AS DWORD ' // SetObjectRects method
pReactivateAndUndo AS DWORD ' // ReactivateAndUndo method
' Custom data
pVtblAddr AS DWORD ' // Address of the virtual table
cRef AS DWORD ' // Reference count
END TYPE
' ****************************************************************************************
' ****************************************************************************************
' Builds the IOleInPlaceObject Virtual Table
' Returns a cookie that is a pointer to a IOleInPlaceObjectVtbl structure.
' ****************************************************************************************
FUNCTION IOleInPlaceObject_BuildVtbl () AS DWORD
LOCAL pVtbl AS IOleInPlaceObjectVtbl PTR
LOCAL pUnk AS IOleInPlaceObjectVtbl PTR
pVtbl = HeapAlloc(GetProcessHeap(), %HEAP_ZERO_MEMORY, SIZEOF(@pVtbl))
IF pVtbl = 0 THEN EXIT FUNCTION
@pVtbl.pQueryInterface = CODEPTR(IOleInPlaceObject_QueryInterface)
@pVtbl.pAddRef = CODEPTR(IOleInPlaceObject_AddRef)
@pVtbl.pRelease = CODEPTR(IOleInPlaceObject_Release)
@pVtbl.pGetWindow = CODEPTR(IOleInPlaceObject_GetWindow)
@pVtbl.pContextSensitiveHelp = CODEPTR(IOleInPlaceObject_ContextSensitiveHelp)
@pVtbl.pInPlaceDeactivate = CODEPTR(IOleInPlaceObject_InPlaceDeactivate)
@pVtbl.pUIDeactivate = CODEPTR(IOleInPlaceObject_UIDeactivate)
@pVtbl.pSetObjectRects = CODEPTR(IOleInPlaceObject_SetObjectRects)
@pVtbl.pReactivateAndUndo = CODEPTR(IOleInPlaceObject_ReactivateAndUndo)
@pVtbl.pVtblAddr = pVtbl
@pVtbl.cRef = 1
pUnk = VARPTR(@pVtbl.pVtblAddr)
FUNCTION = pUnk
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' IOleInPlaceObject_QueryInterface method
' Returns the IUnknown of our class and increments the reference counter.
' ****************************************************************************************
FUNCTION IOleInPlaceObject_QueryInterface (BYVAL pCookie AS IOleInPlaceObjectVtbl PTR, BYREF riid AS GUID, BYREF ppvObj AS DWORD) AS LONG
IF riid = $IID_IOleInPlaceObject THEN
ppvObj = pCookie
INCR @@pCookie.cRef
FUNCTION = %S_OK
ELSE
FUNCTION = %E_NOINTERFACE
END IF
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' IOleInPlaceObject_AddRef method
' Increments the reference counter.
' ****************************************************************************************
FUNCTION IOleInPlaceObject_AddRef (BYVAL pCookie AS IOleInPlaceObjectVtbl PTR) AS DWORD
INCR @@pCookie.cRef
FUNCTION = @@pCookie.cRef
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' IOleInPlaceObject_Release method
' Releases our class if there is only a reference to him and decrements the reference counter.
' ****************************************************************************************
FUNCTION IOleInPlaceObject_Release (BYVAL pCookie AS IOleInPlaceObjectVtbl 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 IOleInPlaceObject_GetWindow (BYVAL pCookie AS IOleInPlaceObjectVtbl PTR, BYREF phwnd AS DWORD) AS LONG
' Put your code here
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' Controls enabling of context-sensitive help.
' ****************************************************************************************
FUNCTION IOleInPlaceObject_ContextSensitiveHelp (BYVAL pCookie AS IOleInPlaceObjectVtbl PTR, BYVAL fEnterMode AS LONG) AS LONG
' Put your code here
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' Deactivate active in-place object.
' ****************************************************************************************
FUNCTION IOleInPlaceObject_InPlaceDeactivate (BYVAL pCookie AS IOleInPlaceObjectVtbl PTR) AS LONG
' Put your code here
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' Deactivate and remove UI of active object.
' ****************************************************************************************
FUNCTION IOleInPlaceObject_UIDeactivate (BYVAL pCookie AS IOleInPlaceObjectVtbl PTR) AS LONG
' Put your code here
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' Portion of in-place object to be visible.
' ****************************************************************************************
FUNCTION IOleInPlaceObject_SetObjectRects (BYVAL pCookie AS IOleInPlaceObjectVtbl PTR, BYREF lprcPosRect AS RECT, BYREF lprcClipRect AS RECT) AS LONG
' Put your code here
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' Reactivate previously deactivated object.
' ****************************************************************************************
FUNCTION IOleInPlaceObject_ReactivateAndUndo (BYVAL pCookie AS IOleInPlaceObjectVtbl PTR) AS LONG
' Put your code here
END FUNCTION
' ****************************************************************************************
|
Page last updated on Monday, 03 April 2006 20:31:56 +0200