关于netmeeting Com组件应用的系统开发
我现在在做视频传输这块,现在碰到这么个问题。如何把传入的视频显示在自己所新建的窗口上,看过一些自带sample,Avpone3工程中好像也没有实现,找相关视频显示的代码只有这些,希望众位多多指教,非常急因为马上要被检查。
- C/C++ code
HWND 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 ); // 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, sizeInPixels.cx, sizeInPixels.cy, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE); } // Don't forget to release interfaces! pOleObjVideoWindow->Release(); } // Don't forget to release interfaces! pUnk->Release(); } } return hWndCtl;}
就是这个没看懂,感觉也没什么用,获得的channel也跟这个无关啊。
[解决办法]
帖子都沉底了!只能帮楼顶到上面,以期更多高手帮楼主解决难题!