我编译了Netmeeting的sdk中的Avphone3的例子发现CreateNetmeetingWindow返回零,也就是里面的CreateWindow 没有成功,用GetLastError()查看了一下错误代码为1407,是没有找到窗口类,代码如下:
HWND CNetmeetingDlg::CreateNetMeetingWindow(HWND hWndParent, int x, int y, LPCTSTR szMode)
{ USES_CONVERSION;

TCHAR szFormatModeString[MAX_PATH];
wsprintf(szFormatModeString, _T("MODE=%s"), szMode); NmInitStruct nmis;
nmis.wSize = sizeof(nmis.str);
wcscpy(nmis.str, T2OLE(szFormatModeString)); LPOLESTR strGUIDNetMeetingActiveXControl = NULL;
StringFromCLSID(CLSID_NetMeeting, &strGUIDNetMeetingActiveXControl);  
HWND hWndCtl = 
::CreateWindow("AtlAxWin",
// Use ATL's string conversion routine to convert to a LPTSTR from an LPOLESTR
         OLE2T(strGUIDNetMeetingActiveXControl),
         WS_CHILD | WS_VISIBLE | WS_GROUP, 
 x, 
 y, 
 0, 
 0, 
 hWndParent, 
 NULL,
         ::GetModuleHandle(NULL), 
 &nmis
 );
if (!hWndCtl)
{
    CString cs;
    cs.Format("%d",  GetLastError());
    AfxMessageBox(cs);
} // Remember to free memory given to you by StringFromCLSID
CoTaskMemFree(strGUIDNetMeetingActiveXControl ); if(hWndCtl)
{


// get the IUnknown for the video window (we want to get it's size)
IUnknown* pUnk = NULL;
HRESULT hr = AtlAxGetControl(hWndCtl, &pUnk);
if(SUCCEEDED(hr))
{
// Now get the IOleObject interface for the netmeeting control
IOleObject* pOleObjVideoWindow = NULL;
hr = pUnk->QueryInterface(&pOleObjVideoWindow);
if(SUCCEEDED(hr))
{
// get the Extent
SIZEL sizel = {0, 0};
hr = pOleObjVideoWindow->GetExtent(DVASPECT_CONTENT, &sizel);
if(SUCCEEDED(hr))
{
// Convert the Extent from HIMETRIC to pixels.
SIZEL sizeInPixels = {0, 0};
AtlHiMetricToPixel(&sizel, &sizeInPixels);
::SetWindowPos(hWndCtl, NULL, 0, 0, 100, 100, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
} // Don't forget to release interfaces!
pOleObjVideoWindow->Release();
} // Don't forget to release interfaces!
pUnk->Release();
}
} return hWndCtl;
}问题好象出在了”AtlAxWin“了。望指教!