Einzelnen Beitrag anzeigen

EWeiss
(Gast)

n/a Beiträge
 
#22

AW: MMX für Delphi ist ab sofort kostenlos!

  Alt 21. Mai 2018, 21:42
Zitat:
Solange das Interface sich in einer gemeinsamen Unit für Hostanwendung und DLL befindet, beide neu kompiliert wurden und man keine harten Casts oder ähnlichen Schmu einsetzt, kann die Sortierung keinen Einfluss auf die Funktionalität haben. Das habe ich sicher schon dutzendfach gemacht.
Klar kann sie das.
Ich habe jetzt extra für dich nochmal einen Test gemacht.

Mein öffentliches Interface sortiert.. (unit SKAeroAPI;) in der Anwendung
Delphi-Quellcode:
ISkinPopUpMenu = interface
  ['{712A92E4-6D43-45DC-9A85-77DDF5EB19B5}']
    function AppendMenu(WinHandle: HWND; uFlags, DlgItemID: UINT; Text: PWideChar): BOOL;
    function CreatePopupMenu(ParentHandle: HWND): HWND;
    procedure CreatePrivateFont(PrivateFontPath: PWideChar; var FontName: string);
    procedure DestroyWindow;
    function GetFontSize: Integer;
    function GetGlassOpacity: Integer;
    function GetHandle: hWnd;
    function GetHeight: Integer;
    function GetIconArrowPath: WideString;
    function GetImageStateMax: Integer;
    function GetItemEnabled: BOOL;
    function GetItemHeight: Integer;
    function GetItemHiliteColor: COLORREF;
    function GetItemIconPath: WideString;
    function GetItemLeft: Integer;
    function GetItemShadow: Integer;
    function GetItemTextAlligment: TTextAlligment;
    function GetItemTextLeft: Integer;
    function GetItemToolTip: PWideChar;
    function GetItemTop: Integer;
    function GetItemWidth: Integer;
    function GetLeft: Integer;
    function GetSelectedImgPath: WideString;
    function GetSeperatorImgPath: WideString;
    function GetSideBarCaption: WideString;
    function GetSideBarCaptionLeft: Integer;
    function GetSideBarCaptionTop: Integer;
    function GetSideBarImgPath: WideString;
    function GetSkinConfigFile: PWideChar;
    function GetSubMenuHandle: HWND;
    function GetSubMenuItemCount: Integer;
    procedure GetTextWidth(Text: WideString; var bW, bH: integer);
    function GetTop: Integer;
    function GetUseSideBar: BOOL;
    function GetUseVistaBlur: BOOL;
    function GetUseVistaCrystal: BOOL;
    function GetWidth: Integer;
    procedure SetFontSize(const Value: Integer);
    procedure SetGlassOpacity(const Value: Integer);
    procedure SetHeight(const Height: Integer);
    procedure SetIconArrowPath(const Value: WideString);
    procedure SetImageStateMax(const Value: Integer);
    procedure SetItemEnabled(const Value: BOOL);
    procedure SetItemHeight(const Value: Integer);
    procedure SetItemHiliteColor(const Value: COLORREF);
    procedure SetItemIconPath(const Value: WideString);
    procedure SetItemLeft(const Value: Integer);
    procedure SetItemShadow(const Value: Integer);
    procedure SetItemTextAlligment(const Value: TTextAlligment);
    procedure SetItemTextLeft(const Value: Integer);
    procedure SetItemToolTip(const Value: PWideChar);
    procedure SetItemTop(const Value: Integer);
    procedure SetItemWidth(const Value: Integer);
    procedure SetLeft(const Value: Integer);
    procedure SetSelectedImgPath(const Value: WideString);
    procedure SetSeperatorImgPath(const Value: WideString);
    procedure SetSideBarCaption(const Value: WideString);
    procedure SetSideBarCaptionLeft(const Value: Integer);
    procedure SetSideBarCaptionTop(const Value: Integer);
    procedure SetSideBarImgPath(const Value: WideString);
    procedure SetSkinConfigFile(const Value: PWideChar);
    procedure SetSubMenuItemCount(const Value: Integer);
    procedure SetTop(const Value: Integer);
    procedure SetUseSideBar(const Value: BOOL);
    procedure SetUseVistaBlur(const Value: BOOL);
    procedure SetUseVistaCrystal(const Value: BOOL);
    procedure SetWidth(const Width: Integer);
    function TrackPopupMenu(WinHandle: HWND; Left, Top, Width, Height: Integer): BOOL; stdcall;
    property FontSize: Integer Read GetFontSize write SetFontSize;
    property GlassOpacity: Integer read GetGlassOpacity write SetGlassOpacity;
    property Handle: hWnd read GetHandle;
    property Height: Integer read GetHeight write SetHeight;
    property IconArrowPath: WideString read GetIconArrowPath write SetIconArrowPath;
    property ImageStateMax: Integer read GetImageStateMax write SetImageStateMax;
    property ItemEnabled: BOOL read GetItemEnabled write SetItemEnabled;
    property ItemHeight: Integer read GetItemHeight write SetItemHeight;
    property ItemHiliteColor: COLORREF read GetItemHiliteColor write SetItemHiliteColor;
    property ItemIconPath: WideString read GetItemIconPath write SetItemIconPath;
    property ItemLeft: Integer read GetItemLeft write SetItemLeft;
    property ItemShadow: Integer read GetItemShadow write SetItemShadow;
    property ItemTextAlligment: TTextAlligment read GetItemTextAlligment write SetItemTextAlligment;
    property ItemTextLeft: Integer read GetItemTextLeft write SetItemTextLeft;
    property ItemToolTip: PWideChar read GetItemToolTip write SetItemToolTip;
    property ItemTop: Integer read GetItemTop write SetItemTop;
    property ItemWidth: Integer read GetItemWidth write SetItemWidth;
    property Left: Integer read GetLeft write SetLeft;
    property SelectedImgPath: WideString read GetSelectedImgPath write SetSelectedImgPath;
    property SeperatorImgPath: WideString read GetSeperatorImgPath write SetSeperatorImgPath;
    property SideBarCaption: WideString Read GetSideBarCaption write SetSideBarCaption;
    property SideBarCaptionLeft: Integer Read GetSideBarCaptionLeft write SetSideBarCaptionLeft;
    property SideBarCaptionTop: Integer Read GetSideBarCaptionTop write SetSideBarCaptionTop;
    property SideBarImgPath: WideString Read GetSideBarImgPath write SetSideBarImgPath;
    property SkinConfigFile: PWideChar Read GetSkinConfigFile write SetSkinConfigFile;
    property SubMenuItemCount: Integer read GetSubMenuItemCount write SetSubMenuItemCount;
    property Top: Integer read GetTop write SetTop;
    property UseSideBar: BOOL read GetUseSideBar write SetUseSideBar;
    property UseVistaBlur: BOOL read GetUseVistaBlur write SetUseVistaBlur;
    property UseVistaCrystal: BOOL read GetUseVistaCrystal write SetUseVistaCrystal;
    property Width: Integer read GetWidth write SetWidth;
end;
Meine Master Interface Unit.. (unit uInterface;) in der DLL unsortiert
Delphi-Quellcode:
ISkinPopUpMenu = interface
  ['{712A92E4-6D43-45DC-9A85-77DDF5EB19B5}']
    function GetHeight: Integer;
    function GetWidth: Integer;
    procedure SetHeight(const Height: Integer);
    procedure SetWidth(const Width: Integer);
    function GetHandle: hWnd;
    function GetSkinConfigFile: PWideChar;
    procedure SetSkinConfigFile(const Value: PWideChar);
    function GetUseVistaBlur: BOOL;
    function GetUseVistaCrystal: BOOL;
    procedure SetUseVistaBlur(const Value: BOOL);
    procedure SetUseVistaCrystal(const Value: BOOL);
    function GetGlassOpacity: Integer;
    procedure SetGlassOpacity(const Value: Integer);
    function GetLeft: Integer;
    function GetTop: Integer;
    procedure SetLeft(const Value: Integer);
    procedure SetTop(const Value: Integer);
    function GetSideBarCaption: WideString;
    function GetSideBarCaptionLeft: Integer;
    function GetSideBarCaptionTop: Integer;
    procedure SetSideBarCaption(const Value: WideString);
    procedure SetSideBarCaptionLeft(const Value: Integer);
    procedure SetSideBarCaptionTop(const Value: Integer);
    function GetFontSize: Integer;
    procedure SetFontSize(const Value: Integer);
    function GetSideBarImgPath: WideString;
    procedure SetSideBarImgPath(const Value: WideString);
    function GetUseSideBar: BOOL;
    procedure SetUseSideBar(const Value: BOOL);
    function GetSelectedImgPath: WideString;
    procedure SetSelectedImgPath(const Value: WideString);
    function GetItemIconPath: WideString;
    procedure SetItemIconPath(const Value: WideString);
    function GetItemHiliteColor: COLORREF;
    procedure SetItemHiliteColor(const Value: COLORREF);
    function GetItemToolTip: PWideChar;
    procedure SetItemToolTip(const Value: PWideChar);
    function GetItemTextAlligment: TTextAlligment;
    procedure SetItemTextAlligment(const Value: TTextAlligment);
    function GetImageStateMax: Integer;
    procedure SetImageStateMax(const Value: Integer);
    function GetItemHeight: Integer;
    procedure SetItemHeight(const Value: Integer);
    function GetItemLeft: Integer;
    function GetItemTop: Integer;
    function GetItemWidth: Integer;
    procedure SetItemLeft(const Value: Integer);
    procedure SetItemTop(const Value: Integer);
    procedure SetItemWidth(const Value: Integer);
    function GetItemShadow: Integer;
    procedure SetItemShadow(const Value: Integer);
    function GetItemTextLeft: Integer;
    procedure SetItemTextLeft(const Value: Integer);
    function GetItemEnabled: BOOL;
    procedure SetItemEnabled(const Value: BOOL);
    function GetIconArrowPath: WideString;
    procedure SetIconArrowPath(const Value: WideString);
    function GetSeperatorImgPath: WideString;
    procedure SetSeperatorImgPath(const Value: WideString);
    function GetSubMenuItemCount: Integer;
    procedure SetSubMenuItemCount(const Value: Integer);
    procedure CreatePrivateFont(PrivateFontPath: PWideChar; var FontName: string);
    procedure GetTextWidth(Text: WideString; var bW, bH: integer);
    function AppendMenu(WinHandle: HWND; uFlags, DlgItemID: UINT; Text: PWideChar): BOOL;
    function GetSubMenuHandle: HWND;
    function TrackPopupMenu(WinHandle: HWND; Left, Top, Width, Height: Integer): BOOL; stdcall;
    property Left: Integer read GetLeft write SetLeft;
    property Top: Integer read GetTop write SetTop;
    property Width: Integer read GetWidth write SetWidth;
    property Height: Integer read GetHeight write SetHeight;
    property Handle: hWnd read GetHandle;
    property GlassOpacity: Integer read GetGlassOpacity write SetGlassOpacity;
    property UseVistaBlur: BOOL read GetUseVistaBlur write SetUseVistaBlur;
    property UseVistaCrystal: BOOL read GetUseVistaCrystal write SetUseVistaCrystal;
    property SkinConfigFile: PWideChar Read GetSkinConfigFile write SetSkinConfigFile;
    property FontSize: Integer Read GetFontSize write SetFontSize;
    property SelectedImgPath: WideString read GetSelectedImgPath write SetSelectedImgPath;
    property SeperatorImgPath: WideString read GetSeperatorImgPath write SetSeperatorImgPath;
    property IconArrowPath: WideString read GetIconArrowPath write SetIconArrowPath;
    property ItemHiliteColor: COLORREF read GetItemHiliteColor write SetItemHiliteColor;
    property ItemToolTip: PWideChar read GetItemToolTip write SetItemToolTip;
    property ItemIconPath: WideString read GetItemIconPath write SetItemIconPath;
    property ItemTextAlligment: TTextAlligment read GetItemTextAlligment write SetItemTextAlligment;
    property ItemHeight: Integer read GetItemHeight write SetItemHeight;
    property ItemWidth: Integer read GetItemWidth write SetItemWidth;
    property ItemLeft: Integer read GetItemLeft write SetItemLeft;
    property ItemTop: Integer read GetItemTop write SetItemTop;
    property ItemShadow: Integer read GetItemShadow write SetItemShadow;
    property ImageStateMax: Integer read GetImageStateMax write SetImageStateMax;
    property ItemTextLeft: Integer read GetItemTextLeft write SetItemTextLeft;
    property ItemEnabled: BOOL read GetItemEnabled write SetItemEnabled;
    property SubMenuItemCount: Integer read GetSubMenuItemCount write SetSubMenuItemCount;
    property UseSideBar: BOOL read GetUseSideBar write SetUseSideBar;
    property SideBarImgPath: WideString Read GetSideBarImgPath write SetSideBarImgPath;
    property SideBarCaption: WideString Read GetSideBarCaption write SetSideBarCaption;
    property SideBarCaptionLeft: Integer Read GetSideBarCaptionLeft write SetSideBarCaptionLeft;
    property SideBarCaptionTop: Integer Read GetSideBarCaptionTop write SetSideBarCaptionTop;
    function CreatePopUpMenu(ParentHandle: HWND): HWND;
    procedure DestroyWindow;
end;
Und die Class des Interface..
Delphi-Quellcode:
  TSkinPopUpMenu = class(TInterfacedObject, ISkinPopUpMenu, ISkinPopUpMenuEx)
  private
    dwTitle: PWideChar;
    dwExStyle: DWORD;
    dwStyle: DWORD;
    wc: TWndClassEx;
    IsInitialized: BOOL;
    FHeight: Integer;
    FWidth: Integer;
    FHPopupWindow: HWND;
    FSkinConfigFile: PWideChar;
    FUseVistaBlur: BOOL;
    FUseVistaCrystal: BOOL;
    FGlassOpacity: Integer;
    FLeft: Integer;
    FTop: Integer;
    FPrivateFont: Pointer;
    FPrivateFontPath: PWideChar;
    FFontName: WideString;
    FSideBarCaption: WideString;
    FSideBarCaptionLeft: Integer;
    FSideBarCaptionTop: Integer;
    FSelectedImgPath: WideString;
    FFontSize: Integer;
    FIcon: array of TIconType;
    FSideBarImgPath: WideString;
    FUseSideBar: BOOL;
    FItemIconPath: WideString;
    FItemHiliteColor: COLORREF;
    FItemToolTip: PWideChar;
    FItemTextAlligment: TTextAlligment;
    FImageStateMax: Integer;
    FItemHeight: Integer;
    FItemWidth: Integer;
    FItemLeft: Integer;
    FItemTop: Integer;
    FItemShadow: Integer;
    FItemTextLeft: Integer;
    FItemEnabled: BOOL;
    FIconArrowPath: WideString;
    FSeperatorImgPath: WideString;
    FSubMenuItemCount: Integer;
    FClientInstance, FPrevClientProc: TFNWndProc;
    FIsSubMenu: BOOL;
    imgW, ImgH: Cardinal;
    ImgSideBar: Cardinal;
    FTrackUser32: Boolean;
    FMouseTracking: BOOL;
    SideBarWidth: Integer;
    ButtonCount: Integer;
    SideBarCount: Integer;
    SubMenuHandleCount: Integer;
    function GetHeight: Integer;
    function GetWidth: Integer;
    procedure SetHeight(const Height: Integer);
    procedure SetWidth(const Width: Integer);
    function GetHandle: HWND;
    function GetSkinConfigFile: PWideChar;
    procedure SetSkinConfigFile(const Value: PWideChar);
    function GetUseVistaBlur: BOOL;
    function GetUseVistaCrystal: BOOL;
    procedure SetUseVistaBlur(const Value: BOOL);
    procedure SetUseVistaCrystal(const Value: BOOL);
    function GetGlassOpacity: Integer;
    procedure SetGlassOpacity(const Value: Integer);
    function GetLeft: Integer;
    function GetTop: Integer;
    procedure SetLeft(const Value: Integer);
    procedure SetTop(const Value: Integer);
    function GetFontName: WideString;
    procedure SetFontName(const Value: WideString);
    function GetSideBarCaption: WideString;
    function GetSideBarCaptionLeft: Integer;
    function GetSideBarCaptionTop: Integer;
    procedure SetSideBarCaption(const Value: WideString);
    procedure SetSideBarCaptionLeft(const Value: Integer);
    procedure SetSideBarCaptionTop(const Value: Integer);
    function GetFontSize: Integer;
    procedure SetFontSize(const Value: Integer);
    procedure ChangeButtonPicture(ButtonCount: Integer; ImageIcon: WideString; HButton: HWND;
      X, Y, W, H: Integer; ArrowIcon: WideString = '');
    function GetHIconFromFile(AFileName: WideString; ASmall: Boolean = false; AIndex: Integer = 0)
      : HIcon;
    function GetSideBarImgPath: WideString;
    procedure SetSideBarImgPath(const Value: WideString);
    function GetUseSideBar: BOOL;
    procedure SetUseSideBar(const Value: BOOL);
    function GetSelectedImgPath: WideString;
    procedure SetSelectedImgPath(const Value: WideString);
    function GetItemIconPath: WideString;
    procedure SetItemIconPath(const Value: WideString);
    function GetItemHiliteColor: COLORREF;
    procedure SetItemHiliteColor(const Value: COLORREF);
    function GetItemToolTip: PWideChar;
    procedure SetItemToolTip(const Value: PWideChar);
    function GetItemTextAlligment: TTextAlligment;
    procedure SetItemTextAlligment(const Value: TTextAlligment);
    function GetImageStateMax: Integer;
    procedure SetImageStateMax(const Value: Integer);
    function GetItemHeight: Integer;
    procedure SetItemHeight(const Value: Integer);
    function GetItemLeft: Integer;
    function GetItemTop: Integer;
    function GetItemWidth: Integer;
    procedure SetItemLeft(const Value: Integer);
    procedure SetItemTop(const Value: Integer);
    procedure SetItemWidth(const Value: Integer);
    function GetItemShadow: Integer;
    procedure SetItemShadow(const Value: Integer);
    function GetItemTextLeft: Integer;
    procedure SetItemTextLeft(const Value: Integer);
    function GetItemEnabled: BOOL;
    procedure SetItemEnabled(const Value: BOOL);
    function GetIconArrowPath: WideString;
    procedure SetIconArrowPath(const Value: WideString);
    function GetSeperatorImgPath: WideString;
    procedure SetSeperatorImgPath(const Value: WideString);
    function FuncExported(stFunc, stModul: PWideChar): Boolean;
    function GetSubMenuItemCount: Integer;
    procedure SetSubMenuItemCount(const Value: Integer);
    function GetIsSubMenu: BOOL;
    procedure SetIsSubMenu(const Value: BOOL);
    procedure ClientWndProc(var Message: TMessage);
    procedure SubClass(WinHandle: HWND);
    procedure UnSubClass(WinHandle: hWnd);
    function GetMouseTracking: BOOL;
    procedure SetMouseTracking(const Value: BOOL);
    function GetPrivateFont: Pointer;
    procedure SetPrivateFont(const Value: Pointer);
    function GetTrackUser32: BOOL;
    procedure SetTrackUser32(const Value: BOOL);
  public
    procedure TrackMouse(WinHandle: HWND);
    procedure CreatePrivateFont(PrivateFontPath: PWideChar; var FontName: string);
    function TrackPopupMenu(WinHandle: HWND; Left, Top, Width, Height: Integer): BOOL; stdcall;
    function AddButton(WinHandle: HWND; DlgItemID: Integer; ImagePath: WideString;
      ItemIconPath: WideString; Text: PWideChar; Left, Top, Width, Height: Integer;
      TextCol: COLORREF; Label3D, ImageStateMax: Integer; TextAlligment: TTextAlligment;
      TextLeft: Integer; ItemToolTip: PWideChar; uFlags: UINT; Enabled: BOOL = True;
      IconArrowPath: WideString = ''): HWND;
    procedure AddSideBar(WinHandle: HWND; DlgItemID: Integer; ImagePath: WideString;
      Left, Top, Width, Height, ImageStateMax: Integer; Enabled, Visible: BOOL);
    procedure GetTextWidth(Text: WideString; var bW: Integer; var bH: Integer);
    function AppendMenu(WinHandle: HWND; uFlags, DlgItemID: UINT; Text: PWideChar): BOOL;
    function GetSubMenuHandle: HWND;
    property Left: Integer read GetLeft write SetLeft;
    property Top: Integer read GetTop write SetTop;
    property Width: Integer read GetWidth write SetWidth;
    property Height: Integer read GetHeight write SetHeight;
    property Handle: HWND read GetHandle;
    property GlassOpacity: Integer read GetGlassOpacity write SetGlassOpacity;
    property UseVistaBlur: BOOL read GetUseVistaBlur write SetUseVistaBlur;
    property UseVistaCrystal: BOOL read GetUseVistaCrystal write SetUseVistaCrystal;
    property SkinConfigFile: PWideChar Read GetSkinConfigFile write SetSkinConfigFile;
    property FontName: WideString read GetFontName write SetFontName;
    property FontSize: Integer read GetFontSize write SetFontSize;
    property SelectedImgPath: WideString read GetSelectedImgPath write SetSelectedImgPath;
    property SeperatorImgPath: WideString read GetSeperatorImgPath write SetSeperatorImgPath;
    property IconArrowPath: WideString read GetIconArrowPath write SetIconArrowPath;
    property ItemHiliteColor: COLORREF read GetItemHiliteColor write SetItemHiliteColor;
    property ItemToolTip: PWideChar read GetItemToolTip write SetItemToolTip;
    property ItemIconPath: WideString read GetItemIconPath write SetItemIconPath;
    property ItemTextAlligment: TTextAlligment read GetItemTextAlligment write SetItemTextAlligment;
    property ItemHeight: Integer read GetItemHeight write SetItemHeight;
    property ItemWidth: Integer read GetItemWidth write SetItemWidth;
    property ItemLeft: Integer read GetItemLeft write SetItemLeft;
    property ItemTop: Integer read GetItemTop write SetItemTop;
    property ItemShadow: Integer read GetItemShadow write SetItemShadow;
    property ItemTextLeft: Integer read GetItemTextLeft write SetItemTextLeft;
    property ItemEnabled: BOOL read GetItemEnabled write SetItemEnabled;
    property SubMenuItemCount: Integer read GetSubMenuItemCount write SetSubMenuItemCount;
    property ImageStateMax: Integer read GetImageStateMax write SetImageStateMax;
    property UseSideBar: BOOL read GetUseSideBar write SetUseSideBar;
    property SideBarImgPath: WideString read GetSideBarImgPath write SetSideBarImgPath;
    property SideBarCaption: WideString read GetSideBarCaption write SetSideBarCaption;
    property SideBarCaptionLeft: Integer read GetSideBarCaptionLeft write SetSideBarCaptionLeft;
    property SideBarCaptionTop: Integer read GetSideBarCaptionTop write SetSideBarCaptionTop;
    property IsSubMenu: BOOL read GetIsSubMenu write SetIsSubMenu;
    property MouseTracking: BOOL read GetMouseTracking write SetMouseTracking;
    property PrivateFont: Pointer read GetPrivateFont write SetPrivateFont;
    property TrackUser32: BOOL read GetTrackUser32 write SetTrackUser32;
    function GetWndInfo(WinHandle: HWND; var WndInfo: TSubMenuWindow): Boolean;
    procedure CreateSubMenu(ItemHandle: HWND; Count: Integer);
    function SubWindowProc(WinHandle: HWND; Msg: UINT; wP: WParam; lP: LParam): LRESULT; stdcall;
    function CreatePopUpMenu(ParentHandle: HWND): HWND;
    destructor Destroy; override;
    constructor Create;
    procedure DestroyWindow;
  end;
Und du willst mir erzählen das die DLL jetzt noch funktionieren soll?
Das möchte ich schwer bezweifeln.

Es geht mir darum das man jedes einzelne Interface inklusive der Classe Sortieren muss.
Tut man es nicht funktioniert die DLL und die Anwendung nicht mehr.
So! Wenn man nun 40 > Units mit Interface hat kann man sich vorstellen wie viel Aufwand es bedarf diese alle zu sortieren.
Sorry das ist Spielerei für mich.
Entweder alles im kompletten Projekt verglichen mit der GUID und zugehöriger Classe oder gar nichts ... so macht es jedenfalls keinen sinn wie es momentan ist.
Da macht man mehr kaputt als es gut ist.

Zusätzlich sollte man sich im klaren sein das wenn man so ein Tool verwendet und solche gravierenden dinge ändert
keine vorherige Anwendung mit dieser DLL mehr funktionstüchtig ist.
Daher entschließt sich mir die Nutzbarkeit eines solchen Tools. (Meine Meinung).

gruss

Geändert von EWeiss (22. Mai 2018 um 00:20 Uhr)
  Mit Zitat antworten Zitat