Jump to content

Davide Visconti

Members
  • Content Count

    21
  • Joined

  • Last visited

Posts posted by Davide Visconti


  1. 14 minutes ago, PeterBelow said:

    This is the kind of problem the IDE's repository was created for. You do not need a wizard for this, just create a template project to serve as the starting point for new projects, and add it to the repository. It is then available in the repository dialog (File -> New -> Others), pick it, immediately do a file -> save project as and start to work on it. For teams of several developers a shared repository can be created on a network path.

    Thanks Peter for the suggestion but the applications could use different units, for example:

     

    Application 1 use these units:

    VISION.Camera.Matrix.Vimba

    VISION.Plc.Siemens

     

    Application 2 use these units:

    VISION.Camera.Matrix.Dalsa

    VISION.Plc.Beckhoff

     

    Application 3 use these units:

    VISION.Camera.Matrix.Vimba

    VISION.Plc.Beckhoff

     

    As you see, the the combinations can be very different, so IMHO the repo wouldn't be the right way.

    Thanks for the suggestion about the Tool menu.


  2. Does anybody suggest me how to develop an IDE tool to support the developers when they start a new project? ...I will try to explain what I mean.

    We have a framework that usually is a starting point for the new applications, I'd like to develop an "IDE Wizard" where the developers can choose the group of units that they want to use.

     

    Eg:

    VISION.Graphics.ImageView

    VISION.Graphics.Roi

    VISION.Credential.User

    VISION.Camera.Matrix.Vimba

    VISION.Input

    VISION.Plc.Siemens

     

    These "IDE Wizard" build a new project with all the necessary units.

     

    Thanks for any suggestions, documentation, code snippet, how to, ...


  3. 23 hours ago, bernhard_LA said:

    I want to evaluate  the pressed button on a form with this code below,  my form (aForm)  should have 2 buttons which the property mrOK.

    
    If  aForm.modalresult = mrOK  then
          begin
              ///   now evaluate which button has been pressed ???
              ....
              ....
         end;

    what  is the best solution for this issue?

     

     

    I don't understand correctly your question... but usually on a dialog form you have 2 buttons with different results. mrOk / mrCancel or mrYes / mrNo.

    if AForm.ShowModal = mrOk then
    begin
    	// Ok button pressed
    	// do some stuff...
    end
    else 
    begin
    	// Cancel button pressed
    	// do other stuff...
    end;

    Anyway, if you have to (for any strange reason) set 2 buttons with the same result values... you must store in a variable the user choise, button A or button B.

    TMyDialogForm = class(TForm)
    private
    	FSelectedButton : Integer;
    public
    	property SelectedButton : Integer read FSelectedButton;
    end;
    
    //...
    
    procedure TMyDialogForm.BtnAClick(Sender: TObject);
    begin
    	// Store the button pressed inside the FSelectedButton variable
    	FSelectedButton := 1;
    	ModalResult := mrOk;
    end;
    
    procedure TMyDialogForm.BtnBClick(Sender: TObject);
    begin
    	// Store the button pressed inside the FSelectedButton variable
    	FSelectedButton := 2;
    	ModalResult := mrOk;
    end;

    I hope it helps you.

     


  4. Hello @ertank

     

    is it possible that on that machine are presents different parameters or configuration files that may cause the problem?

     

    How many times the problem appear? Becasue, in my experience, if the problem is on the RAM module you should get a lot of problems... and not only on your application.

    Anyway, get any linux distro and test the RAM or get this one (https://www.memtest86.com/)

     

     


  5. Thank you so much for any suggestion.

     

    Since the web applications is not our core business and because we don't have a lot of time to learn any other languages, we choosed the UniGui framework to speed up the development process.
    In this first months we get a good impression of UniGui, yes there is some "memory leak", but overall, the results obtained so far are enough.

     

    I would like them to improve customer support because IMHO isn't enough.

    Thanks again.


  6. 3 hours ago, David Heffernan said:

    Very hard to see anything useful coming from this. Can't imagine any way for Delphi to directly consume a managed assembly other than COM. 

     

    I'd consider making your own COM wrapper of the assembly, using C#, or writing a Delphi wrapper around the C interface. 

    Thanks David, if I have to write a wrapper in C# to expose the COM.... I definitely prefer write a Delphi wrapper over C dll, that's what usually we do (.h --> .pas).

    Thank you anyway for the suggestion.


  7. Hi,

     

    I've upgrade a library to the new version, we usually import this library as Type Library (COM object) in Delphi (since "yesterday"). Now, in this new version the COM object are no longer supported, so I'm looking around.
     

    image.png.3153ccd972fb5ce53960e0a22d822a6f.png

     

    The new library support the C# .NET, C++ (unmanaged), C++ (managed) and C.

    I know that I can use the C .dll with a Delphi wrapper but... Just out of curiosity I tried to import the .NET Assembly.

    I never use the .NET Assembly before, and honestly I don't know very well what is the .NET Assembly.

    I'm searching on google and I found some documentations, but before start reading I ask you if you know a good start point "Delphi and .NET Assembly".

     

    Do you have experience with that?

     

    After the import I get the wrapper with a lot of class/interface but they are all empty.

     

    Eg:

    // *********************************************************************//
    // Interface: _HObject
    // Flags:     (4432) Hidden Dual OleAutomation Dispatchable
    // GUID:      {8E90512D-E586-352A-A70F-C7F1518E667D}
    // *********************************************************************//
      _HObject = interface(IDispatch)
        ['{8E90512D-E586-352A-A70F-C7F1518E667D}']
      end;
    
    // *********************************************************************//
    // Interface: _HImage
    // Flags:     (4432) Hidden Dual OleAutomation Dispatchable
    // GUID:      {2D195846-332C-32E4-A6A3-8B089435BB54}
    // *********************************************************************//
      _HImage = interface(IDispatch)
        ['{2D195846-332C-32E4-A6A3-8B089435BB54}']
      end;

     

    Any suggestion will be appreciate.

    Thank you, as always, for your time.

     

     


  8. Hi all,

     

    I'm searching a way to intercept, in Windows 10, some classic windows shortcuts like the Windows key, Ctrl+alt+canc, Ctrl+esc, Alt+tab, etc...

    My goal is to limit the user access to my application and let the windows access at some other users with high privilege.

     

    Do you know something like that?

    Thanks.


  9. This work.

    Do you have any suggestions?

    procedure TFrmMain.Btn1Click(Sender: TObject);
    var
      LCtx             : TRttiContext;
      LType1           : TRttiType;
      LField1          : TRttiField;
      LNestedType1     : TRttiType;
      LRttiInstanceType: TRttiInstanceType;
      LMeth            : TRttiMethod;
      LObj             : TObject;
    begin
      LCtx         := TRttiContext.Create;
      LType1       := LCtx.GetType(MyTool.ClassType);
      LField1      := LType1.GetField('MyClass');
      LObj         := LField1.GetValue(MyTool).AsObject;
      LNestedType1 := LCtx.GetType(LField1.FieldType.Handle);
      LMeth        := LNestedType1.GetMethod('Run');
      // LMeth.Invoke(MyTool.MyClass, []); // ok
      // LMeth.Invoke(LNestedType1.AsInstance.ClassInfo, []); // fail
      LMeth.Invoke(LObj, []);
    end;

     


  10. type
      TMyClass = class
      public
        procedure Run;
      end;
    
      TMyTool = class
      public
        MyClass: TMyClass;
        constructor Create;
      end;
    
    ...
    var
      MyTool: TMyTool;
    
    procedure TFrmMain.FormCreate(Sender: TObject);
    begin
      MyTool := TMyTool.Create;
    end;
    procedure TFrmMain.Btn1Click(Sender: TObject);
    var
      LCtx             : TRttiContext;
      LType1           : TRttiType;
      LField1          : TRttiField;
      LNestedType1     : TRttiType;
      LRttiInstanceType: TRttiInstanceType;
      LMeth            : TRttiMethod;
    begin
      LCtx         := TRttiContext.Create;
      LType1       := LCtx.GetType(MyTool.ClassType);
      LField1      := LType1.GetField('MyClass');
      LNestedType1 := LCtx.GetType(LField1.FieldType.Handle);
      LMeth        := LNestedType1.GetMethod('Run');
      // LMeth.Invoke(MyTool.MyClass, []);  		// <-- ok
      LMeth.Invoke(LNestedType1.AsInstance, []);	// <-- fail
    end;

     

    I get "invalid class typecast" I understand where is the problem but I don't know how to resolve it.

    I have to call the method "MyClass.Run" through RTTI.

    Can you help me please?

    Any suggestion will be appreciated.

    Thank you.

     

     


  11. 15 hours ago, Alexander Elagin said:

    Have you tried this library: https://blog.grijjy.com/2017/01/30/efficient-and-easy-to-use-json-and-bson-library/

    Just a week ago I had to implement a JSON file reader - never used JSON before - and decided to try this library. It was surprisingly easy to use.

    Wow!

    Very powerful.

    I'll try it ASAP because I'm searching a serialize/deserialize library.

     

    Thanks for sharing.


  12. Hi, I state that I have no skills on the argument, so bear with me.
    I have read a lot since last week but the argument is really a jungle and I'd like to read your very useful suggestions.

     

    I try to explain what we have to do.
    At the moment we have a win32 application developed in VCL Delphi Tokyo. This app read/write on localhost Firebird DB. Now, we have to realize a web application, like a dashboard , wich the users can utilize to see some values, some charts, execute some predefined queries and change some parameters on DB, the VCL app get some notifications when this happened (event alert) to update the in memory parameters.
    This web app should run on computer and android mobile too, like this forum 🙂
    The number of clients connected are very few, maximum 5.

     

    Now, according to you, what library, framework, we have to use for the front-end...?
    For the back end? I have to use a REST service like @Andrea Magni's MARS Curiosity?


    Finally, can you give me some guide or how-to that you've found useful to begin please?

     

    THANKS A LOT for any suggestions.

×