Jump to content

aehimself

Members
  • Content Count

    1030
  • Joined

  • Last visited

  • Days Won

    22

Posts posted by aehimself


  1. 6 minutes ago, mtjmohr said:

    Here is the design form.

    03-01-_2021_09-19-55.png

    Yep, socket is not on the form therefore not created automatically. Delete the public declaration and drop one on your form.

     

    Edit: on newer Delphi editions TServerSocket and TClientSocket are not available on the palette by default. Do make them appear, go to Component -> Install Package, click on "Add..." and browse for $(BDS)\bin\dclsocketsXXX.bpl.

    Depending on your Delphi version, the XXX changes. On 10.4.1, my full path is C:\Program Files (x86)\Embarcadero\Studio\21.0\bin\dclsockets270.bpl

     

    After this, you can drop one on your form in Design time.

     

    Edit-Edit: If you are wondering, I think this is what happened. As I mentioned, designtime components are not available by default on newer Delphi editions. You started the source in Delphi, it warned you about a component which can not be found and you clicked on Remove. Now, the program would not compile as all ServerSocket1 references are invalid. Then, you manually declared it. The issue is, if it's not on the DFM it's not being created automatically for you.


  2. Is the TServerSocket component placed on the form design time?

     

    Because it is in the declaration 3 times, 2 times commented out, finally placed in the "public" section:

      TfrmMain = class(TForm)
        ADOConnection1: TADOConnection;
        ADOQuery1: TADOQuery;
        //ServerSocket1: TServerSocket; // one occurrence
      private
        { Private declarations }
        //ServerSocket1: TServerSocket; // one occurrence
     public
        { Public declarations }
        ServerSocket1: TServerSocket; // final occurrence
        DCP_sha11: TDCP_sha1;
        DCP_3des1: TDCP_3des;
      end;

    I suspect it's not created automatically.

    Delete the component from the form, doublecheck that the public declaration is removed (if no, remove it manually) and put an other component on the form.

     


  3. That line is a declaration, which is not executing under any circumstances. An AV can not occur there. The exception is thrown in SetPort:

    procedure TAbstractSocket.SetPort(Value: Integer);
    begin
      if FPort <> Value then
      begin
        if not (csLoading in ComponentState) and FActive then
          raise ESocketError.CreateRes(@sCantChangeWhileActive);
        FPort := Value;
      end;
    end;

    I start to wonder... is 0x40 low enough to be a nullpointer exception?

    Can you post your FormCreate code?

     


  4. What methods is the DLL exporting - more importantly what type of parameters are being exchanged between the DLL and the EXE?

    If you are using PChars, doublecheck the allocation: instead of GetMem(pc, Length(inString)) you have to use GetMem(pc, Length(inString) * SizeOf(Char)) because of the Unicode difference @Angus Robertson mentioned.

     

    I can confirm that TClientSocket / TServerSocket works fine even in Delphi 10.3, with String or raw (binary) transfer as well - one of my applications were using those before I switched to ICS.


  5. On 9/2/2020 at 8:09 PM, ConstantGardener said:

    TSpeedButton dont show the correct font anymore. You can change it to any font/Size and so on, but the font stay's the same.

     

    On 9/3/2020 at 8:03 PM, richardcarn1 said:

    Speedbuttons (VCL) are using the Tahoma font. ParentFont=True and Tahoma isn't the parent font.

     

    I faced this today and the fix is fairly simple. I recompiled VCL.Buttons.pas and now all font styling is working as expected.

     

    DIY:

    1, Open up vcl.buttons.pas, after line 1715 insert:

          LCanvas.Font := Canvas.Font;

    2, Go to C:\Program Files (x86)\...\lib\win32\debug, release, win64\debug, release and delete vcl.buttons.dcu

    3, Fire up Delphi, create a new VCL application and drop a button on the form. Add Win64 platform, then build the empty application in Win32/Win64 Release/Debug.

    4, Go to %USERPROFILE%\Documents\Embarcadero\Studio\Projects and copy the vcl.buttons.dcu from Win32/Win64 Release/Debug to your Delphi installations "lib" folder.

     

     

    Keep in mind that this is a modification of the local installation's VCL so it is machine dependent. You have to do this on every developer machine / build server you have.
    I have the modified source and the built DCUs but I don't know if I'm allowed to attach those here; so to keep it safe and simple, just follow these steps.

     

     

    Let's hope that this will get patched in the lifetime of 10.4.1. I doubt I can convince my boss to upgrade everything one more time.


  6. Which operating system are we talking about?

    2 seconds sounds like the default DNS client timeout.

    Sometime around Windows 8 (needs clarification, I'm not sure), the following lines appeared in the Windows hosts file:

     

    # localhost name resolution is handled within DNS itself.
    #    127.0.0.1       localhost
    #    ::1             localhost

     

    You can try to uncomment these and give an other try. It's possible that your DNS settings needs to be checked / updated.


  7. 42 minutes ago, emailx45 said:

    RAD 10.4.x = BLACK-HOLE in programming universe!

    Strongly disagree. 10.4.1 is a lot more useable on our large project at work than any previous version was. Sure, it's far away from perfect, but it does not mean it's a "black hole".

    17 hours ago, Attila Kovacs said:

    don't understand ppl. using this very new (not mature enough) feature, especially in 3rd party products.

    Tbh I was already shocked that inline variables will be added to the language. Was it community requested? Majority of the coders are staying away from it as far as I heard.

    • Like 2

  8. 6 hours ago, y2nd66 said:

    If a default character set was not specified when the database was created, the character set defaults to NONE. Using CHARACTER SET NONE means that there is no character set assumption for columns; data is stored and retrieved just as you originally entered it.

    Doesn't this equal to a localized ANSI codepage...? In this case a solution would be to

    1, Convert the underlying DB to UTF-8-16 and forget about encodings for a while

    2, Change the access components to one which allows you to tell the RDBMS in what codepage string literals should be converted to before sending it to you - if Interbase supports this. Zeos has this and so does FireDac (as far as I see from Google).

    3, Override the String field's OnGetText event and manually covert the byte array to a Unicode string on-the-fly

    4, Feels a bit hacky but you also can go through all tables, read all string fields as a byte array, convert them to Unicode and put them back like that


  9. 2 hours ago, limelect said:

    with a lot of goodies inside.

    Good for a school project; I don't see any other purpose for applications which - mostly - do things what a built-in Windows command does.

    If a user doesn't know how to invoke them from the command line they most probably don't need / shouldn't use.

     

    11 hours ago, Angus Robertson said:

    use UDP broadcasts in some way, that is how most devices discover each other on a LAN.  One device listens on a unique port, and responds with it's IP address and details when it hears a broadcast.

    Even I already used this in one of my applications I completely forgot about this. Yes, for finding your own software on a network segment UDP broadcasting is the way to go.

     

    I might be completely wrong on this one, but afaik broadcasts can not be relayed to an other subnet, though. Never tried it and didn't work with broadcasts since, so take this with a grain of salt.


  10. I fell in love with A4Tech products since I bought my first, which was a A4Tech 4D+ dual scroll PS/2 mouse way back in high school. With only a small amount of exceptions, ergonomically they suited me the best.

    Although I didn't have a desktop PC for 15+ years now, when my mouse died I felt lucky that the XL-750BK was still available. At work I also changed my keyboard with the G800V I had laying around at home. They are also marked as "gaming" products but no fancy RGB, only keys which can be macroed and higher resolution / data transfer rates.

     

    If I'll have to change again, I'll look into A4Tech first for sure.


  11. Can anyone confirm that this only happens on Windows 2004?

     

    Yesterday after installing the MS Windows patches offered by the company my "View unit" button stopped working, while it was fine before. Same Delphi version (10.4.1) on a different machine, receiving updates from MS directly (therefore, instead of 2004 it's 20H2) it's all fine.


  12. If DateInFuture > Now Then
      seconds := SecondsBetween(Now, DateInFuture)
    else
      // Date already passed

    Then you can divide seconds down to years, months, etc.

     

    Alternatively, you can use YearsBetween, MonthsBetween, etc.


  13. 7 hours ago, David Heffernan said:

    That is beside the point of this topic. Remember what the OP has actually asked. 

    What OP actually asked and what he wanted to ask are two different things. We assumed what he would like to know and offered directions in how to achieve it. Now our assumptions might be wrong of course but with the information available this is how far one can get.

     

    I suppose OP's proficiency in English is not native. At least some of us attempted to help.


  14. 7 minutes ago, David Heffernan said:

    And you don't think that maybe, just maybe, Delphi isn't the best tool for this? 

    Best? Definitely no. Capable of, while being good enough? Absolutely.

    My own compiled Delphi code will always consume less resources (and will be more trustworthy to me) than PHP, for example.

×