Einzelnen Beitrag anzeigen

Assarbad
(Gast)

n/a Beiträge
 
#1

IPropertyPage macht Problämchen

  Alt 17. Nov 2003, 16:12
Hiho,

ich arbeite grade mit IPropertyPage um eine HTML-Seite in einem nonVCL-Prog dazustellen. Das ganze sieht so aus:

Delphi-Quellcode:
    WM_INITDIALOG:
      begin
// Load settings
        LoadRegistrySettings(hwnd);
        SendDlgItemMessage(hwnd, IDC_RICHEDIT_AGREEMENT, EM_SETBKGNDCOLOR, 0, RGB($DD, $DD, $DD));
        SetWindowLong(GetDlgItem(hwnd, IDC_RICHEDIT_AGREEMENT),
          GWL_USERDATA,
          SetWindowLong(GetDlgItem(hwnd, IDC_RICHEDIT_AGREEMENT), GWL_WNDPROC, Integer(@RichEditSubclassWndProc)));
        CoInitialize(nil);
        lib := LoadLibrary('MSHTML.DLL');
        if lib <> 0 then
        begin
          @CreateHTMLPropertyPage := GetProcAddress(lib, 'CreateHTMLPropertyPage');
          if CreateURLMoniker(nil, 'http://www.erm.tu-cottbus.de/rules/crrules.shtml', pUrlMoniker) = S_OK then
            if CreateHTMLPropertyPage(pUrlMoniker, ppPropertyPage) = S_OK then
            begin
              pUrlMoniker._Release;
              GetWindowRect(GetDlgItem(hwnd, IDC_RICHEDIT_AGREEMENT), rect);
              ScreenToClient(hwnd, rect.TopLeft);
              ScreenToClient(hwnd, rect.BottomRight);
              DestroyWindow(GetDlgItem(hwnd, IDC_RICHEDIT_AGREEMENT));
              ppPropertyPage.Activate(hwnd, rect, True);
            end;
        end;
      end;
    WM_CLOSE:
      begin
// Close the dialog and end the message loop
        ppPropertyPage.Deactivate;
        ppPropertyPage._Release;
        FreeLibrary(lib);
        CoUninitialize;
        EndDialog(hwnd, wParam);
      end;
Das Problem ist nun, dass hinter dem Code in meiner Main-Procedure ploetzlich wahlweise na Exception oder ein Fehler 216 auftritt. Hat jemand ne Idee wo das passiert? ZB in welcher Unit.

Danke im Voraus

Oliver
  Mit Zitat antworten Zitat