CSDN博客

img bohut

在利用Mfc编写activex控件时取得控件容器句柄

发表于2004/11/1 9:14:00  1158人阅读

//如果是取容器接口指针
LPOLECONTAINER lpContainer;
HRESULT hr = m_pClientSite->GetContainer(&lpContainer);

//如果是取窗口句柄
HWND m_hWndParent;
IOleInPlaceSite *pOleInPlaceSite = NULL;
if (NOERROR==m_pClientSite->QueryInterface(IID_IOleInPlaceSite, (LPVOID *)&pOleInPlaceSite))
{
 pOleInPlaceSite->GetWindow((HWND *)&m_hWndParent);
 pOleInPlaceSite->Release();
}

0 0

相关博文

我的热门文章

img
取 消
img