(CodeLib-Manager)
Registriert seit: 10. Jun 2002
4.648 Beiträge
Delphi XE Professional
|
IOleCommandTarget & Invalid Variant Type
23. Mär 2005, 21:55
Hallo~!
Warum kriege ich bei Zeile 11 einen Invalid Variant Type?
Delphi-Quellcode:
function HrExecCommand(ucmdID: cardinal; const pVarIn: OleVariant;
var pVarOut: OleVariant; bPromptUser: boolean): HResult;
const
CMDSETID_Forms3: TGUID = '{DE4BA900-59CA-11CF-9592-444553540000}';
var
dwCmdOpt: cardinal;
OleCommandTarget: IOleCommandTarget;
begin
dwCmdOpt := OLECMDEXECOPT_DONTPROMPTUSER;
Webbrowser1.Document.QueryInterface(IOleCommandTarget, OleCommandTarget);
result := OleCommandTarget.Exec(@CMDSETID_Forms3, // Invalid Variant Type!!!!
ucmdID,
dwCmdOpt,
pVarIn,
pVarOut);
end;
Delphi-Quellcode:
procedure TfrmMyBrowser.GetAvailableStyles(List: TStrings);
const
IDM_GETBLOCKFMTS = 2233;
var
varRange: OleVariant;
b: TBStr;
a: PSafeArray;
l, h, i: Longint;
hr: HRESULT;
NullVariant: OleVariant;
begin
TVariantArg(VarRange).VT := VT_ARRAY;
TVariantArg(VarRange).ppArray := nil;
hr := HrExecCommand(IDM_GETBLOCKFMTS, unassigned, VarRange, False);
//....
end;
Thomas
|
|
Zitat
|