Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi PropertySheet in Anwendung (https://www.delphipraxis.net/88045-propertysheet-anwendung.html)

flowj 9. Mär 2007 10:47


PropertySheet in Anwendung
 
Hallo,

ich habe ein PropertySheet als dll welche ich eigentlich zur Verwendung als Display Specifier im Active Directory verwende! Nun möchte ich dieses Sheet in eine Anwendung reinbekommen als Formular in ein TabSheet.
Ist das irgendwie möglich und wie?

Gruss

mkinzler 9. Mär 2007 10:57

Re: PropertySheet in Anwendung
 
Sheet als Parent eintragen

flowj 9. Mär 2007 11:16

Re: PropertySheet in Anwendung
 
muss ich da in der PropertySheet-dll was verändern?
könntest du es vielleicht ein bisschen genauer erklären?
das wäre echt super!

mkinzler 9. Mär 2007 11:22

Re: PropertySheet in Anwendung
 
Ist die Dll in Delphi geschrieben?
Füge im Interface der Dll doch die Möglichkeit der Parented-Erzeugung ein.

flowj 26. Mär 2007 09:17

Re: PropertySheet in Anwendung
 
ja die dll ist in delphi geschrieben!
aber ich will an der dll nix ändern und das ganze als COM Object in meiner Anwendung verwenden?
Also das PropertySheet ist registriert und ich will nicht die dll verwenden sondern über COM Interface gehen!
Ist das möglich?

mkinzler 26. Mär 2007 09:52

Re: PropertySheet in Anwendung
 
Wenn die Dll einen ActiveX-Server und ein ActiveX-Objekt implemnetiert, kannst du diese ja wieder in Delphi importieren und verwenden. Einfacher wäre aber der Weg mit der Erweiterung des Interfaces.

flowj 26. Mär 2007 10:14

Re: PropertySheet in Anwendung
 
und was mach ich dann wenn ich das importiert habe?

mkinzler 26. Mär 2007 10:15

Re: PropertySheet in Anwendung
 
Die Komponente auf das Sheet ziehen

flowj 26. Mär 2007 14:45

Re: PropertySheet in Anwendung
 
ich wäre jetz so vorgegangen:

in meiner anwendung habe ich so ein interface:

Delphi-Quellcode:
type
  IPSheetTest = interface(IUnknown)
    ['{E6292C5D-5FBB-4BF8-911F-CC61132982DD}']
    function QueryInterface(const IID: TGUID; out Obj): Integer; stdcall;
    function _AddRef: Integer; stdcall;
    function _Release: Integer; stdcall;
    function propdlgproc(hDlg: HWND; uMsg: UINT; wp: WPARAM; lp: LPARAM): boolean; stdcall;
  end;
Die Funktion "propdlgproc" möchte ich aus dem COM Objekt aufrufen! Sieht so aus:

Delphi-Quellcode:
procedure TForm3.FormCreate(Sender: TObject);
var
  LSheet: IPSheetTest;
  tmpPropSheet : PROPSHEETPAGE;
  LDAPUrl: String;
begin
  LDAPUrl := 'ldap://blablabla';
  tmpPropSheet.lParam := Integer(LDAPUrl);
  tmpPropSheet.hInstance := TabSheet1.Handle;
  LSheet := IPSheetTest(CreateComObject(IPSheetTest));
  LSheet.propdlgproc(self.Handle,WM_INITDIALOG, 0, Integer(@tmpPropSheet))
end;
Nur hauts ihn leider bei "LSheet.propdlgproc" auf die Schnauze. Weiß jemand woran das liegen könnte? Geht das überhaupt mit der Funktion propdlgproc einfach hinzufügen?

Remko 27. Mär 2007 10:48

Re: PropertySheet in Anwendung
 
There's a sample in the PSDK (PropSheetHost) that might help. I started a conversion of the sample to Delphi (http://www.delphipraxis.net/internal...=propsheethost) but due to lack of time it's not finished (yet).

Are you trying to show a standard Active Directory property page or your own added property page?

mkinzler 27. Mär 2007 11:03

Re: PropertySheet in Anwendung
 
No he wrotes his own Display Specifier in a dll and wants to use it in an "normal" Delphi-Application

flowj 28. Mär 2007 11:11

Re: PropertySheet in Anwendung
 
thats right!
i want to show my own-created Active Directory Property-Page in a 'standalone' Application!

Remko 28. Mär 2007 15:02

Re: PropertySheet in Anwendung
 
The PSDK sample show the default ADUC property page in your own application (which should also include your page). Perhaps you can use it or adapt it for your own property page? The sample uses:
Delphi-Quellcode:
constructor Create(hInstance: Cardinal; hwndParent: HWND);
I'm assuming you pass the tabsheet handle as hwndParent.

Can you attach your complete code?

flowj 29. Mär 2007 10:08

Re: PropertySheet in Anwendung
 
Hi!
thx for your advices...this helps me quite a lot!
yes i will post it when i have finished it but...
where can i get the files like...JwaActiveX, JwaDSClient, JwaAdsTLB???

Remko 29. Mär 2007 10:13

Re: PropertySheet in Anwendung
 
They're in the Jedi ApiLib. You need the Win32 Api.

Some more info that might assist you: Can I change the PropSheetHost SDK sample project from .exe to dll

flowj 2. Apr 2007 08:59

Re: PropertySheet in Anwendung
 
hi,
i have a problem creating and setting the COM Object.

Delphi-Quellcode:
procedure TForm3.FormCreate(Sender: TObject);
var
  sheethost: TPropSheetHost;
  Liads: IADs;
  guid: TGUID;
begin
  sheethost := TPropSheetHost.Create(hInstance(Self), Self.Handle);
  guid := StringToGUID('{2E461895-1B42-4214-8B09-704509A6CDB7}');
  OleCheck(sheethost.QueryInterface(guid, Liads));
  sheethost.SetObject(Liads);
end;
On calling "sheethost.QueryInterface(guid, Liads)", i get the Error message "interface not supported" !

Any ideas?

Remko 2. Apr 2007 10:03

Re: PropertySheet in Anwendung
 
{2E461895-1B42-4214-8B09-704509A6CDB7} Is the GUID to your added sheet? Please check if it's properly registered (search the registry for it). Can you open the normal propsheet?

Why not try to first call the normal propsheet?:

Delphi-Quellcode:
sheethost := TPropSheetHost.Create(hInstance(Self), Self.Handle);
// Hold a reference count for the CPropSheetHost object.
sheethost.AddRef;
sheethost.SetObject('LDAP://CN=SomeUser,DC=Domain,DC=Local');
sheethost.Run;
{
Release the CPropSheetHost object. Other components may still hold a
reference to the object, so this cannot just be deleted here. Let
the object delete itself when all references are released.
}
sheethost.Release;


Alle Zeitangaben in WEZ +1. Es ist jetzt 09:50 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz