HRESULT Cvp::OpenFile(CString szFile)
{
if(m_status != isStop) Stop(); WCHAR wFile[MAX_PATH];
MultiByteToWideChar(CP_ACP,0,szFile.GetBuffer(_MAX_PATH),-1,wFile,MAX_PATH); szFile.ReleaseBuffer();
HRESULT hr;
if (FAILED(QueryInterface())) AfxMessageBox(_T("GetInterfaces failed."));
m_pG->QueryInterface(IID_IMediaPosition, (void **)&m_pP);
hr = m_pG->RenderFile(wFile,NULL);
if(SUCCEEDED(hr)) hr = m_pP->get_Duration(&m_tLength);
m_status = isPlayfile;
return hr;
}在unicode模式下,出现
error C2664: “MultiByteToWideChar”: 不能将参数 3 从“wchar_t *”转换为“LPCSTR”
请教怎么改正这个错误??
{
if(m_status != isStop) Stop(); WCHAR wFile[MAX_PATH];
MultiByteToWideChar(CP_ACP,0,szFile.GetBuffer(_MAX_PATH),-1,wFile,MAX_PATH); szFile.ReleaseBuffer();
HRESULT hr;
if (FAILED(QueryInterface())) AfxMessageBox(_T("GetInterfaces failed."));
m_pG->QueryInterface(IID_IMediaPosition, (void **)&m_pP);
hr = m_pG->RenderFile(wFile,NULL);
if(SUCCEEDED(hr)) hr = m_pP->get_Duration(&m_tLength);
m_status = isPlayfile;
return hr;
}在unicode模式下,出现
error C2664: “MultiByteToWideChar”: 不能将参数 3 从“wchar_t *”转换为“LPCSTR”
请教怎么改正这个错误??
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货