的代码: If WebBrowser.Document.activeElement Is Nothing Then 转为Delphi代码怎么写? 用下面函数都不行: VarIsNull() VarIsEmpty() VarType(WebBrowser.Document.activeElement)返回的是vtDispatch,但无法判断是否nothing
function IsNothing(Dispatch: Variant): Boolean;
var
disp: IDispatch;
begin
Result:= VarIsType(Dispatch, varDispatch);
if Result then
begin
disp:= Dispatch;
Result:= disp = nil;
end;
end;