CreateFeatureMgrView2

I have a C++ COM addin dll and want to create my own FeatMgrView. This works properly using the ModelViewManager class. But the window handle of the created FeatMgrView does not seem to be valid.

See the following code fragment:

CComPtr doc = current_doc(); //returns the active document
CComPtr view_mgr;
CComPtr feat_mgr;

hres = doc->get_ModelViewManager(&view_mgr);

view_mgr->CreateFeatureMgrView2(_T("picture.bmp"), _T("ToolTip"), swFeatMgrPaneBottom, &feat_mgr);

long hwnd;;
hres = feat_mgr->GetFeatMgrViewWnd(&hwnd);
if (!::IsWindow((HWND)_hwnd))
return; //I do not expect this to happen

Unfortunately, IsWindow always returns false, even if I activate the view.

On the other hand, if I replace the line before ::IsWindow by
view_mgr->GetFeatureMgrViewHWnd(...),
then I get a valid window handle but it is always the handle of the top pane (the Feature Manager).

So what goes wrong?

RobertSolidworksApi macros