0

I have IE 9 and Delphi XE2. I am executing IDM_Replace to show the replace dialog for mshtml editable content in a twebbrowser. The dialog opens but there is nothing on it. It is blank.

The IDM_FIND command works as it should. What could be wrong?

EDITED to show code

  execidmcommand_out(IDM_replace); // does work but shows blank dialog

  execidmcommand_out(IDM_Find); // Works fine and so does other idm commands



procedure TForm2.execidmcommand_out(const command: Integer);
var
  Target: IOleCommandTarget;
  Valin, Valout: OleVariant;
  PtrGUID: PGUID;
outdoc2:ihtmldocument2;
begin

outdoc2:=webbrowser1.document as ihtmldocument2;

  outdoc2.QueryInterface(IID_IOleCommandTarget, Target);
  New(PtrGUID);
  PtrGUID^ := CGID_MSHTML;
//   Valin := 1;
  Target.Exec(PtrGUID, command, 0, Valin, Valout);
  Dispose(PtrGUID);
end;
Ali
  • 309
  • 1
  • 3
  • 12
  • Do you have any code? Also, the fact that you have IE9 is not particularly relevant. The web browser component will display content in a legacy mode unless you take steps to opt-out of that behaviour. – David Heffernan Sep 09 '13 at 13:55
  • Not that it will change anything, but you don't need heap allocation here. Allocate a `TGUID` local variable and get its address with the `@` operator. – David Heffernan Sep 09 '13 at 14:06

0 Answers0