Jump to content

Lajos Juhász

Members
  • Content Count

    948
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by Lajos Juhász

  1. Lajos Juhász

    Several F2084 Internal Error on Delphi 10.4.2

    According to the last roadmap there will be no 10.4.3 release, the release will be 10.5 in H2 2021.
  2. Lajos Juhász

    TDBGrid's SelectedRows count

    You're trying to show the change on the dbgrid while using an event on the dataSource that's is triggered before the selection. You should display the selected rows from the events of the grid. In this case as the selection can be made by mouse or keyboard you could use the events OnKeyUp and OnMouseUp for the grid: procedure TForm1.DBGrid1KeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); begin UpdateSelectedCount; end; procedure TForm1.DBGrid1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin UpdateSelectedCount; end; procedure TForm1.UpdateSelectedCount; begin label2.Caption := 'Count = ' + IntToStr(dbgrid1.SelectedRows.Count); end;
  3. Lajos Juhász

    FireDac Batchmove

    For this you should configure replication on the server IMHO that works best.
  4. Lajos Juhász

    Several F2084 Internal Error on Delphi 10.4.2

    Unfortunately no, sometime I also get internal error or Access violation at address 50165C8F in module 'rtl270.bpl'. Read of address 00000000.
  5. Lajos Juhász

    Possible D10.4.2 issue..

    It's enough to insert anything between ShowModal and Free that will call an Application.ProcessMessages, for example to show another modal form and oops you get: Project Project1.exe raised exception class EInvalidPointer with message 'Invalid pointer operation'. Something like: procedure TForm1.Button1Click(Sender: TObject); var x: TForm2; x2: TForm; begin x:=TForm2.Create(nil); x2:=nil; try x2:=Tform2.Create(nil); if x.ShowModal=mrOk then x2.showmodal; finally x.free; x2.free; end; end;
  6. Lajos Juhász

    Possible D10.4.2 issue..

    No it's not wrong. Sometimes it can result an Access Violation, it will cause no problem if in the meanwhile the handle is not used otherwise you cannot predict the result.
  7. Lajos Juhász

    Update hidden file

    TFileStream is derived from THandleStream and unlike the THandleStream it will close the file in the destructor as I showed in my earlier post, so it's just a try ... finally less to write.
  8. Lajos Juhász

    Update hidden file

    The answer is here, the TFileStream will take over the ownership and close it in the destructor (FileClose will call CloseHandle): destructor TFileStream.Destroy; begin if FHandle <> INVALID_HANDLE_VALUE then FileClose(FHandle); inherited Destroy; end;
  9. Lajos Juhász

    Update hidden file

    Thanks Remy I missed the part that you can give a Handle to the TFileStream constructor. You can replace the file using this code. Of course you've to make sure first the file exists: procedure TForm1.FormCreate(Sender: TObject); var lStrList: TStringList; lfStream: TFileStream; lFileName: PChar; begin lFileName:='D:\temp\0104.txt'; lStrList:=TStringList.Create; lfStream:=TFileStream.Create(Createfile(lFileName, GENERIC_WRITE, FILE_SHARE_WRITE, nil, CREATE_ALWAYS, GetFileAttributes(lFileName), 0)); try lStrList.SaveToStream(lfStream); finally lfStream.Free; end; end;
  10. Lajos Juhász

    Update hidden file

    Please read the posts and think about them before you start a google search and copy some content that has nothing to do with the question and the thread you paste. So what is the relation with you stackoverflow post and System.SysUtils.FileCreate?!
  11. Lajos Juhász

    Possible D10.4.2 issue..

    deleted
  12. Lajos Juhász

    Update hidden file

    You're right. A hidden file can be replaced only with a hidden file. Unfortunately you cannot create a hidden file as in FileCreate the attribute is hard coded to be FILE_ATTRIBUTE_NORMAL.
  13. I think is a poorly engineered code for the IDE. As I scanned the code most probably only the initialization section requires the VCL.Controls and for this one: GroupDescendentsWith(TOleServer, Vcl.Controls.TControl); I've no idea where is this used as find in files returns that RegGroups is only used in System.Classes so my guess is that it is for the IDE. Why they polluted the code only to be used in the IDE? Most probably it could be moved in some package used only by the IDE and not pollute user executables. I wonder what @Marco Cantu, @David Millington or @Dmitry Arefiev can publicly say about this case.
  14. Lajos Juhász

    Object Inspector issue in 10.4.2??

    I've tested on at 2K resolution, both 100% and 150% working without a problem. Instead of TLMDButton I used TButton (when possible you should report bugs on a standard components so anyone can verify).
  15. Lajos Juhász

    Delphi 10.4.2 first impressions

    In order to get the stack overflow you've to activate the debug the IDE. Create a new empty package. In Run -> Parameters set Host application to C:\Program Files (x86)\Embarcadero\Studio\21.0\bin\bds.exe. Run and click continue for the Debugger exception notifications. When the second instance of the IDE appear open a project and then you can see the stack overflow.
  16. Lajos Juhász

    Delphi 10.4.2 first impressions

    For me also the IDE asked for international characters (looks like the forum likes to insert those ones). Congratulation you managed to make Delphi unresponsive without debugging. With debug I also get: Project bds.exe raised exception class $C00000FD with message 'stack overflow at 0x51ef04f2. :51ef04f2 ; C:\Windows\SysWOW64\msxml6.dll :51f16f2d ; C:\Windows\SysWOW64\msxml6.dll :51f56860 ; C:\Windows\SysWOW64\msxml6.dll :51f296da ; C:\Windows\SysWOW64\msxml6.dll :51f566ea ; C:\Windows\SysWOW64\msxml6.dll :51f18b90 ; C:\Windows\SysWOW64\msxml6.dll :51f18163 ; C:\Windows\SysWOW64\msxml6.dll xmlrtl.Xml.Win.msxmldom.TMSDOMNodeList.get_length xmlrtl.Xml.XMLDoc.TXMLNode.GetIsTextElement :0c1b42ec ; c:\program files (x86)\embarcadero\studio\21.0\Bin\IDELSP270.bpl :0c1b4390 ; c:\program files (x86)\embarcadero\studio\21.0\Bin\IDELSP270.bpl :0c1b4390 ; c:\program files (x86)\embarcadero\studio\21.0\Bin\IDELSP270.bpl :0c1b4390 ; c:\program files (x86)\embarcadero\studio\21.0\Bin\IDELSP270.bpl :0c1b4390 ; c:\program files (x86)\embarcadero\studio\21.0\Bin\IDELSP270.bpl .....cut, here the IDELSP270.bpl repeats 9992 times..... :0c1b4390 ; c:\program files (x86)\embarcadero\studio\21.0\Bin\IDELSP270.bpl :0c1b4390 ; c:\program files (x86)\embarcadero\studio\21.0\Bin\IDELSP270.bpl fmx.FMX.Platform.Win.TPlatformWin.ThreadSync(???) rtl.System.Classes.StdWndProc(1705986,0,0,0) vcl.Vcl.Forms.TApplication.ProcessMessage(???)
  17. I've tried to compare XML documentation in XE5 and 10.4. For this I've copied an example from the documentation http://docwiki.embarcadero.com/RADStudio/Sydney/en/XML_Documentation_Comments: /// <summary> Removes the specified item from the collection /// </summary> /// <param name="Item">The item to remove /// </param> /// <param name="Collection">The group containing the item /// </param> /// <remarks> /// If parameter "Item" is null, an exception is raised. /// <see cref="EArgumentNilException"/> /// </remarks> /// <returns>True if the specified item is successfully removed; /// otherwise False is returned. /// </returns> function RemoveItem(Item: Pointer; Collection: Pointer): Boolean; begin // Non-XML DOC comment // ... end; In the attachment its clear that 10.4.1 in order to save some space will combine summary, parameter descriptions, remark and return value. I why is this changed?
  18. Lajos Juhász

    Is XML Documentation in Delphi 10.4 is 105% broken?

    It's now working again in Delphi 10.4.2.
  19. Lajos Juhász

    TTreeNode leak when VCL styles are active

    You forgot to remove the build event. I've tested with Delphi 10.4.2 and the bug is still there: --------------------------- Unexpected Memory Leak --------------------------- An unexpected memory leak has occurred. The unexpected small block leaks are: 13 - 20 bytes: UnicodeString x 2 21 - 28 bytes: UnicodeString x 4 45 - 52 bytes: TTreeNode x 6 --------------------------- OK --------------------------- PS. It looks like that seBorder in the TListView's Styleelement is the problem. Remove it and the leak dissapear!
  20. Lajos Juhász

    loop a table field

    while FDTableTask.EOF do begin FDTableTask.First; end; This is not correct first will move the cursor to the beginning of the query. You should call FDTableTask.Next, also if the loop contains only the call for the next record you can replace the loop with FDTableTask.Last to jumb to the last record.
  21. Lajos Juhász

    TIdSSLIOHandlerSocketOpenSSL.MaxLineAction issue.

    The source of Indy is delivered with Delphi so you can find it easily. It's in IdGlobal.pas.
  22. Lajos Juhász

    Quickly zero all local variables?

    IMHO it's not the sam RSP-24383 is about var parameters. The parameter intToStr is not a var parameter. For example: procedure TForm1.FormCreate(Sender: TObject); var i: record a,b,c: integer; end; a: integer; begin i.a:=i.b; IntToStr(a); IntToStr(i.c); end; I have only one warning: [dcc32 Warning] Unit1.pas(35): W1036 Variable 'a' might not have been initialized
  23. Lajos Juhász

    Quickly zero all local variables?

    I have found a case that there is no warning for records: procedure TForm1.FormCreate(Sender: TObject); var i: record a,b : integer; end; begin showmessage(IntToStr(i.a)); showmessage(i.a.ToString); end;
  24. Lajos Juhász

    Convert two Integers to a DateTime??

    If you have enough decimals you can do: Hours + minutes / 60
×