FabDev
Members-
Content Count
81 -
Joined
-
Last visited
Everything posted by FabDev
-
Hello, I use Drag and Drop Component Suite since a long time and its work fine. But I don't know how to handle drag&drop between 2 VCL applications (same application execute at same time for example). But not file or URL just "common" Delphi components. Just a TForm with a Tlabel. Tlabel.Drag : Unit17.pas unit Unit17; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls; type TForm17 = class(TForm) Label1: TLabel; procedure Label1DragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); private { Déclarations privées } public { Déclarations publiques } end; var Form17: TForm17; implementation {$R *.dfm} procedure TForm17.Label1DragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); begin accept:=true; Showmessage('DragOVer from '+ Sender.name); end; end. Unit17.dfm : object Form17: TForm17 Left = 0 Top = 0 Caption = 'Form17' ClientHeight = 347 ClientWidth = 728 Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = 'Tahoma' Font.Style = [] OldCreateOrder = False OnCreate = FormCreate PixelsPerInch = 96 TextHeight = 13 object Label1: TLabel Caption = 'Drag Label' DragMode = dmAutomatic end end Between 2 components on the same form or application it's not a problem. But execute 2 times this application : Drag&drop from label1 in application 1 to label1 in application 2 is not working... How to handle drag&drop between this label in each running application ?
-
Drag and drop component between applications
FabDev replied to FabDev's topic in RTL and Delphi Object Pascal
Hello Anders, First congratulation for your great component that I use since more than 10 years ! If you are a namesake 😉 This copy now : https://github.com/landrix/The-Drag-and-Drop-Component-Suite-for-Delphi My problem is that I need drag&drop from a grid to another grid in another different form. Each form are always shown in task bar using : procedure TForm1.CreateParams(var Params: TCreateParams); begin inherited; Params.ExStyle := Params.ExStyle and not WS_EX_APPWINDOW; Params.WndParent := Application.Handle; end; But when the second form is only visible in taskbar (in background or minimized for example) it's doesn't react at the drag&drop (when mouse is moved over the form button in task bar). The destination form doesn't come in foreground like an application do when it's detect drag&drop. So I will try your solution.... -
Hello, I have tested CData components (Free with Delphi Enterprise version). It's is a very interesting components set : All API, Webservice become "Table and queries". But I have a problem if you integrate the component to open Excel file your executable is increased by 14 MB ! I need to add 5 or 10 CData components (like Excel, Excel Online, FTP etc.). After this the executable size do more than 100 MB. With runtime library it's the same problem. The customers of my software don't need to use all components each time. So I would like to dynamically load the BPL file using LoadPackage when needed. To do this I use I try to use LoadPackage like this : procedure TForm10.Button1Click(Sender: TObject); var PackageModule: HModule; AClass: TPersistentClass; begin PackageModule := LoadPackage('CData.Excel.D26.bpl'); if PackageModule <> 0 then begin AClass := GetClass('TFDPhysCDataExcelDriverLink');// no effect with ('TFDPhysCDataExcelDriver'); if AClass <> nil then begin with TComponentClass(AClass).Create(Application) as TFDPhysCDataExcelDriverLink do begin create(self); // FDPhysManager().RegisterDriverClass(TFDPhysCDataExcelDriverLink); // FDConnection1.Name := 'SQLTest'; FDPhysManager().RegisterRDBMSKind(cDBMSKindCData, S_CData_DriverID); // FDPhysManager().RegisterDriverClass(TFDPhysCDataExcelDriverLink); FDConnection1.DriverName := 'CData.Excel'; with FDConnection1.Params as TFDConnectionDefParamsClass do begin add('File=C:\MyExcelWorkbooks\SampleWorkbook.xlsx'); end; FDQuery1.SQL.clear; FDQuery1.SQL.add('SELECT * FROM Sheet WHERE FirstName = ''Bob'''); FDQuery1.ExecSQL; Free; end; end else showmessage('error'); UnloadPackage(PackageModule); end; end; Initialization RegisterClass(TFDPhysCDataExcelDriverLink); // RegisterClass(TFDPhysCDataExcelDriver); end. But at line "FDQuery1.ExecSQL;" I get this error "[Firedac][Phys]-300 Driver [CData.Excel] is not registered. Correct The ID of the driver or define the virtual drivers [CDATA.Excel] in FDDrivers.ini". Certainly because a line like this is missing : FDPhysManager().RegisterDriverClass(TFDPhysCDataExcelDriver); But I don't know how to dynamically Register a driver class to Firedac ! Any idea ? (Full source in attachment) DynamicBPLExcel.zip
-
Yes it's better to avoid ambiguity of "Self" but in this case by default Delphi seems to consider (Self=Form10). But I think that it miss something like (done in initialization of unit FireDAC.Phys.CDataExcel.pas) : FDPhysManager().RegisterDriverClass(TFDPhysCDataExcelDriver); But : AClass2 := GetClass('TFDPhysCDataExcelDriver'); Return nil...
-
Delphi v10.3.3 IDE instant crashes on search/refactor
FabDev replied to Yaron's topic in Delphi IDE and APIs
Hello, Same problem for me. Look at this : https://quality.embarcadero.com/browse/RSP-23476