問題是這樣的,起初我想做一個Sink的Filter,所以我在製作時用到了產生dll檔的程式,
////////TSFileSink.cpp部分程式碼
STDAPI DllRegisterServer()
{
return AMovieDllRegisterServer2(TRUE);
} // DllRegisterServer
// DllUnregisterServer
//
STDAPI DllUnregisterServer()
{
return AMovieDllRegisterServer2(FALSE);
} // DllUnregisterServer
// DllEntryPoint
//
extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);
BOOL APIENTRY DllMain(HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved)
{
return DllEntryPoint((HINSTANCE)(hModule), ul_reason_for_call, lpReserved);
}
///////以下是用到的方法
HRESULT CDataIn::CheckMediaType(const CMediaType *pmt)
STDMETHODIMP CDataIn::EndOfStream()
HRESULT CDataIn::BeginFlush()
HRESULT CDataIn::EndFlush()
HRESULT CDataIn::Receive(IMediaSample *pSample)
//////以下是製作TSFileSink.def的方式
LIBRARY TSFileSink.dll
EXPORTS
DllMain PRIVATE
DllGetClassObject PRIVATE
DllCanUnloadNow PRIVATE
DllRegisterServer PRIVATE
DllUnregisterServer PRIVATE
///////////////////////////////////////////////
可是在Build過程中,產生了error
warning C4355: 'this' : used in base member initializer list
Linking...
TSFileSink.def : error LNK2001: unresolved external symbol DllCanUnloadNow
TSFileSink.def : error LNK2001: unresolved external symbol DllGetClassObject
Debug/TSFileSink.lib : fatal error LNK1120: 2 unresolved externals
LINK : fatal error LNK1141: failure during build of exports file
Error executing link.exe.
TSFileSink.exe - 4 error(s), 1 warning(s)
///////
麻煩請各位高手幫幫忙,是不是我建立def檔時有誤呢?或者是製作程式中有誤呢?
萬分感激!!!
------解决方案--------------------------------------------------------
没有导出DllCanUnloadNow等函数啊
------解决方案--------------------------------------------------------
GUID重定义了,在mediaformats.h与uuids.h中,H264VideoFormat等GUID重定义了。
检查下mediaformats.h中的定义试着更改声明以避免。