註冊DLL檔的方法:
regsvr32 //註冊動態連結檔
regsvr32 -u //解除動態連結檔
————
[錯誤訊息] 正在停用的啟用內容不是最近啟動的那一個
0xC015000F: The activation context being deactivated is not the most recently activated one.
程式碼中加入
CWinApp::InitInstance();
afxAmbientActCtx = FALSE;
————
[警告訊息] 二進位碼不是以偵錯資訊而建置
專案屬性 -> 組態屬性 -> C/C++ ->最佳化 -> 停用
專案屬性 -> 組態屬性 -> 連結器 -> 命令列 -> 輸入 /debug
————
[DirectShow] 控制MPEG-2 Demultiplexer Filter的Pin
IMpeg2Demultiplexer *pDemux = NULL;
hr = m_pDemux->QueryInterface(IID_IMpeg2Demultiplexer, (void**)&pDemux);
GRAPH_LOG(gcMsgLog.LogToFile("QueryInterface()= %x",hr));
if (SUCCEEDED(hr))
{
pDemux->DeleteOutputPin(L"004"); //刪除Pin腳
// Define the media type.
AM_MEDIA_TYPE mt;
ZeroMemory(&mt, sizeof(AM_MEDIA_TYPE));
mt.majortype = MEDIATYPE_Audio;
mt.subtype = MEDIASUBTYPE_MPEG2_AUDIO;
mt.formattype = FORMAT_WaveFormatEx;
// Create a new output pin.
IPin *pPin;
hr = pDemux->CreateOutputPin(&mt, L"PSI Pin", &pPin);
GRAPH_LOG(gcMsgLog.LogToFile("CreatOutputPin()= %x",hr));
if (SUCCEEDED(hr))
{
// Map the PID.
IMPEG2PIDMap *pPidMap = NULL;
hr = pPin->QueryInterface(IID_IMPEG2PIDMap, (void**)&pPidMap);
if (SUCCEEDED(hr))
{
ULONG cPid = 1;
ULONG Pid[] = {0x00} ; // Map any desired PIDs.
hr = pPidMap->MapPID(cPid, Pid, MEDIA_MPEG2_PSI);
//pPidMap->Release();
}else
GRAPH_LOG(gcMsgLog.LogToFile("QueryTinterface__()=%x",hr));
//pPin->Release();
}
}
搶先發佈留言