このリンクをたどって、ActiveXコントロールのウィンドウハンドルを取得しました
マイクロソフトのサイトからのサンプルコード
// The following code should return the actual parent window of the ActiveX control.
HWND CMyOleControl::GetActualParent()
{
HWND hwndParent = 0;
// Get the window associated with the in-place site object,
// which is connected to this ActiveX control.
if (m_pInPlaceSite != NULL)
m_pInPlaceSite->GetWindow(&hwndParent);
return hwndParent; // Return the in-place site window handle.
}
しかし、私の場合、「m_pInPlaceSite」は常にNULLであることがわかります。コントロールのFinalConstructでこのコードを実行しようとしています。m_pInPlaceSiteに値を指定するために、他に実装する必要があるものはありますか?または、値を取得するためにクエリを実行する必要がありますか。
ありがとう