Autor Beitrag
toms
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1099
Erhaltene Danke: 2



BeitragVerfasst: Do 24.03.05 17:20 
Hallo~!

Warum kriege ich bei Zeile 11 einen Invalid Variant Type?


ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
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;


ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
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;
toms Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1099
Erhaltene Danke: 2



BeitragVerfasst: So 27.03.05 18:24 
Hat niemand eine Idee hier?
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: So 27.03.05 18:30 
Welchen Typ erwartet Exec beim ersten Parameter?

AXMD
toms Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1099
Erhaltene Danke: 2



BeitragVerfasst: So 27.03.05 19:15 
ausblenden Delphi-Quelltext
1:
2:
    function Exec(CmdGroup: PGUID; nCmdID, nCmdexecopt: DWORD;
      const vaIn: OleVariant; var vaOut: OleVariant): HResult; stdcall;
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: So 27.03.05 21:20 
Hilft Casten auf PGUID vielleicht?

AXMD