Skip to content

Instantly share code, notes, and snippets.

@zer0tonin
Created May 12, 2026 08:39
Show Gist options
  • Select an option

  • Save zer0tonin/0d94ec52ef77e1ff5b2374a6a5257bf9 to your computer and use it in GitHub Desktop.

Select an option

Save zer0tonin/0d94ec52ef77e1ff5b2374a6a5257bf9 to your computer and use it in GitHub Desktop.
CInPlaceFrame
''
'true' CInPlaceFrame + a "class" that implements the IOleInPlaceFrame interface
''
#include once "crt/string.bi"
#include "Common.bi"
''::::
private function CInPlaceFrame_QueryInterface _
( _
byval _this as IOleInPlaceFrame ptr, _
byval riid as REFIID, _
byval ppvObj as PVOID ptr _
) as HRESULT
dim as CInPlaceFrame ptr self_ = cast( CInPlaceFrame ptr, _this )
LOG_FUNC()
if( memcmp( riid, @IID_IOleInPlaceFrame, len( GUID ) ) = 1 ) then
*ppvObj = @self_->interface
return S_OK
end if
*ppvObj = NULL
function = E_NOINTERFACE
end function
''::::
private function CInPlaceFrame_AddRef _
( _
byval _this as IOleInPlaceFrame ptr _
) as ULONG
LOG_FUNC()
function = 0
end function
''::::
private function CInPlaceFrame_Release _
( _
byval _this as IOleInPlaceFrame ptr _
) as ULONG
LOG_FUNC()
function = 2
end function
'false'::::
private function CInPlaceFrame_GetWindow _
( _
byval _this as IOleInPlaceFrame ptr, _
byval lphwnd as HWND ptr _
) as HRESULT
LOG_FUNC()
*lphwnd = cast( CInPlaceFrame ptr, _this )->hwnd
function = S_OK
end function
''::::
private function CInPlaceFrame_ContextSensitiveHelp _
( _
byval _this as IOleInPlaceFrame ptr, _
byval fEnterMode as BOOL _
) as HRESULT
LOG_FUNC()
function = E_NOTIMPL
end function
''::::
private function CInPlaceFrame_GetBorder _
( _
byval _this as IOleInPlaceFrame ptr, _
byval lprectBorder as LPRECT _
) as HRESULT
LOG_FUNC()
function = E_NOTIMPL
end function
''::::
private function CInPlaceFrame_RequestBorderSpace _
( _
byval _this as IOleInPlaceFrame ptr, _
byval pborderwidths as LPCBORDERWIDTHS _
) as HRESULT
LOG_FUNC()
function = E_NOTIMPL
end function
''::::
private function CInPlaceFrame_SetBorderSpace _
( _
byval _this as IOleInPlaceFrame ptr, _
byval pborderwidths as LPCBORDERWIDTHS _
) as HRESULT
LOG_FUNC()
function = E_NOTIMPL
end function
''::::
private function CInPlaceFrame_SetActiveObject _
( _
byval _this as IOleInPlaceFrame ptr, _
byval pActiveObject as IOleInPlaceActiveObject ptr, _
byval pszObjName as LPCOLESTR _
) as HRESULT
LOG_FUNC()
function = S_OK
end function
''::::
private function CInPlaceFrame_InsertMenus _
( _
byval _this as IOleInPlaceFrame ptr, _
byval hmenuShared as HMENU, _
byval lpMenuWidths as LPOLEMENUGROUPWIDTHS _
) as HRESULT
LOG_FUNC()
function = E_NOTIMPL
end function
''::::
private function CInPlaceFrame_SetMenu _
( _
byval _this as IOleInPlaceFrame ptr, _
byval hmenuShared as HMENU, _
byval holemenu as HOLEMENU, _
byval hwndActiveObject as HWND _
) as HRESULT
LOG_FUNC()
function = S_OK
end function
''::::
private function CInPlaceFrame_RemoveMenus _
( _
byval _this as IOleInPlaceFrame ptr, _
byval hmenuShared as HMENU _
) as HRESULT
LOG_FUNC()
function = E_NOTIMPL
end function
''::::
private function CInPlaceFrame_SetStatusText _
( _
byval _this as IOleInPlaceFrame ptr, _
byval pszStatusText as LPCOLESTR _
) as HRESULT
LOG_FUNC()
function = S_OK
end function
''::::
private function CInPlaceFrame_EnableModeless _
( _
byval _this as IOleInPlaceFrame ptr, _
byval fEnable as BOOL _
) as HRESULT
LOG_FUNC()
function = S_OK
end function
''::::
private function CInPlaceFrame_TranslateAccelerator _
( _
byval _this as IOleInPlaceFrame ptr, _
byval lpmsg as LPMSG, _
byval wID as WORD _
) as HRESULT
LOG_FUNC()
function = E_NOTIMPL
end function
'' constructor
function CInPlaceFrame_New _
( _
byval _this as CInPlaceFrame ptr, _
byval hwnd as HWND _
) as CInPlaceFrame ptr
static as IOleInPlaceFrameVtbl vtbl = _
( _
@CInPlaceFrame_QueryInterface, _
@CInPlaceFrame_AddRef, _
@CInPlaceFrame_Release, _
@CInPlaceFrame_GetWindow, _
@CInPlaceFrame_ContextSensitiveHelp, _
@CInPlaceFrame_GetBorder, _
@CInPlaceFrame_RequestBorderSpace, _
@CInPlaceFrame_SetBorderSpace, _
@CInPlaceFrame_SetActiveObject, _
@CInPlaceFrame_InsertMenus, _
@CInPlaceFrame_SetMenu, _
@CInPlaceFrame_RemoveMenus, _
@CInPlaceFrame_SetStatusText, _
@CInPlaceFrame_EnableModeless, _
@CInPlaceFrame_TranslateAccelerator _
)
if( _this = NULL ) then
_this = cast( CInPlaceFrame ptr, allocate( len( CInPlaceFrame ) ) )
if( _this = NULL )then
return NULL
end if
end if
_this->interface.lpVtbl = @vtbl
_this->hwnd = hwnd
function = _this
end function
'' destructor
sub CInPlaceFrame_Delete _
( _
byval _this as CInPlaceFrame ptr, _
byval isstatic as integer _
)
if( isstatic = TRUE ) then
if( _this <> NULL ) then
deallocate( _this )
end if
end if
end sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment