#include <dshow.h>
#include <iostream>
using namespace std;
int main()
{
char *inFilterAx = "dsnet.ax"; //名稱
int returncode = 0;
//typedef(WINAPI * REGISTER_FUNC) (void);
//注意鹉勒,VC++6.0和vs2008的區(qū)別。
typedef int( WINAPI *REGISTER_FUNC)(void);
REGISTER_FUNC MyFunc =? NULL;
HMODULE hModule = ::LoadLibrary(inFilterAx);
if (hModule)
{
//獲取注冊所需的函數(shù):DllRegisterServer.
MyFunc = (REGISTER_FUNC)GetProcAddress(hModule,"DllRegisterServer");
BOOL pass = (MyFunc!=NULL);
if (pass)
{
MyFunc();
cout<<"注銷過濾器蚓聘,請按回車毙替!/n";
cin.get();
//獲取注銷函數(shù):DllUnregisterServer.
MyFunc = (REGISTER_FUNC)GetProcAddress(hModule,"DllUnregisterServer");
pass = (MyFunc!=NULL);
if (pass)
{
MyFunc();
cout<<"過濾器已經(jīng)注銷了是辕!/n按任意鍵關(guān)閉此窗口苗缩。/n";
cin.get();
}
else
{
cout<<"無法注銷,請按任意鍵關(guān)閉此窗口/n";
cin.get();
returncode = 1;
}
}
else
{
cout<<"無法獲取DllRegisterServer侨拦!/n";
cin.get();
returncode = 2;
}
::FreeLibrary(hModule);
//return 0;
}
else
{
cout<<"無法加載庫粱挡!/n";
cin.get();
returncode = 3;
//return 1;
}
return returncode;
}