如何使用DirectShow加载Delphi7中的.ax文件未注册的.ax过滤器?我找到了C++中的一个例子,我不知道如何把它翻译成Delphi。
发布于 2017-05-22 08:04:29
function LoadFilter(const Fhandle: HMODULE; clis: TGUID): IBaseFilter; overload;
Var
DllGetClassObject: Function(Const clsid, IID: TGUID; Var Obj)
: HRESULT; STDCALL;
ClassF: IClassFactory;
Begin
result := nil;
try
If Fhandle = 0 Then
exit;
// NOTE: Fhandle is typically obtained as a result of LoadLibrary API
// call loading DLL hosting the DirectShow filter
DllGetClassObject := GetProcAddress(Fhandle, 'DllGetClassObject');
DllGetClassObject(clis, IClassFactory, ClassF);
if assigned(ClassF) then
begin
if ClassF.CreateInstance(nil, IID_IBaseFilter, result) = ERROR_SUCCESS
then
exit;
end;
except
exit;
end;
end;https://stackoverflow.com/questions/44107238
复制相似问题