20080725 c# directshow 2
http://www.shengfang.org
错误 1 error C2593: “operator ==”不明确 167
错误 1 error LNK2001: 无法解析的外部符号 _IID_IMediaControl
src_sf.exe 中的 0x0041335d 处未处理的异常: 0xC0000005: 读取位置 0x00000000 时发生访问冲突
在tools->option下的directory设置include的路径为SDK的路径,还包含project->settings->link下的object里输入Strmbase.lib winmm.lib
http://hi.baidu.com/notepad519/blog/item/d8b75e2449441e044d088d08.html
error C2593: 'operator <<' is ambiguous error C2679: binary '>>'
AfxMessageBox(_T("Can't realize the settings!"));
YES
因为你在建立工程的时候选用了UNICODE这一选项(默认的)
AfxMessageBox' : none of the 2 overloads could convert all the argument types
d:\program files\microsoft visual studio 8\vc\atlmfc\include\afxwin.h(5025): could be 'int AfxMessageBox(LPCTSTR,UINT,UINT)'
d:\program files\microsoft visual studio 8\vc\atlmfc\include\afxwin.h(5027): or 'int AfxMessageBox(UINT,UINT,UINT)'
while trying to match the argument list '(const char [28], long)'
默认情况程序:
void ChelloView::OnDraw(CDC* pDC)
{
ChellovcDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
if (!pDoc)
return;
// TODO: 在此处为本机数据添加绘制代码
pDC->TextOutW (30,30,_T("hello"));
}
不钩选 Unicode 库(N) 前面的复选框的程序:
void ChelloView::OnDraw(CDC* pDC)
{
ChellovcDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
if (!pDoc)
return;
// TODO: 在此处为本机数据添加绘制代码
pDC->TextOut(20,20,"hello!");
}
CString strFileName;
CFileDialog dlg( TRUE, NULL, NULL, OFN_ALLOWMULTISELECT, NULL, NULL );
DWORD MAXFILE = 2412; // allocate enough memory space
dlg.m_ofn.nMaxFile = MAXFILE; // set the buffer size
char* buf = new char[MAXFILE];
dlg.m_ofn.lpstrFile = buf;
dlg.m_ofn.lpstrFile[0] = NULL;
int iReturn = dlg.DoModal();
if(iReturn == IDOK)
{
POSITION pos = dlg.GetStartPosition();
while (pos != NULL)
{
strFileName=dlg.GetNextPathName(pos); // get the individual file name
// do some operations here
}
}
else if(iReturn == IDCANCEL) AfxMessageBox("Cancel");
delete [] buf;
The RenderFile() function returns a (0x80040216) error message for the following method:
hr = graph->RenderFile (filename,NULL);
It works fine if I hard code the path like
hr = graph->RenderFile (L"c:\\vmsencoding1\\movies\\stage\\10404.mpg", 0);
I tried to declare filename as LPOLESTR ,LPCWSTR ,wchar_t*,
_TCHAR* and tried various castings too withourt any development.