扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
作者:维维编译 来源:天极开发 2007年11月21日
关键字:
BOOL CWMP8SampleDlg::OnInitDialog() { CDialog::OnInitDialog(); // Set the icon for this dialog. The framework does this // automatically when the application's main window is not // a dialog SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon CenterWindow(GetDesktopWindow()); // center to the hpc screen CRect rect; m_Panel.GetClientRect(&rect); if ( m_PlayerWnd.CreateControl(__uuidof(WMP),L"", WS_VISIBLE|WS_CHILD,rect, &m_Panel,AFX_IDW_PANE_FIRST) ) { LPUNKNOWN lpUnk = m_PlayerWnd.GetControlUnknown(); HRESULT hr = lpUnk->QueryInterface(__uuidof(IWMP),(void**) &m_spWMPPlayer); } else { AfxMessageBox(L"Failed to create WMP control"); ::PostQuitMessage(0); return 0; } if ( m_spWMPPlayer ) { m_WMPEvents.m_pMainDlg = (CWMP8SampleDlg*)this; CComPtr<IConnectionPointContainer> spConnectionContainer; HRESULT hr = m_spWMPPlayer-> QueryInterface( IID_IConnectionPointContainer, (void**)&spConnectionContainer ); if (SUCCEEDED(hr)) { hr = spConnectionContainer-> FindConnectionPoint( __uuidof(_IWMPEvents), &m_spConnectionPoint ); } if (SUCCEEDED(hr)) { hr = m_spConnectionPoint->Advise((IDispatch*)&m_WMPEvents, &m_dwAdviseCookie ); } else { AfxMessageBox(L"Failed to get WMP control events"); ::PostQuitMessage(0); return 0; } if ( FAILED(SetupWMP()) ) { AfxMessageBox(L"Failed to setup WMP control"); ::PostQuitMessage(0); return 0; } } m_spWMPPlayer->Stop(); return TRUE; // return TRUE unless you set the focus to a // control } |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者