Recent

Recent Posts

Pages: [1] 2 3 ... 10
1
Other / Re: How to fu*k the Windows Defender
« Last post by BrassGear on Today at 03:24:10 pm »
(image)

Would enabling the option to strip symbols from the executable (-Xs on that screen) also be likely to cause the heuristics to trip, or is the strip option in the original post something different?
2
General / Re: Assign (textfile) not compiling - sometimes.
« Last post by Thaddy on Today at 03:16:52 pm »
If it were a beginner I would rephrase it. The one that made the suggestion is no beginner.
Assign() and Close() existed before some idiots mixed up the language without thinking.
Fixing a symptom without analyzing the cause is plain ignorance.
And this is such a case that is not only obvious, but obnoxious. IOW toxic language pollution.
3
General / Re: How to: create DLL file for Windows 10 64-Bit Pro
« Last post by paule32 on Today at 03:05:49 pm »
The following will crash the application ( WriteFile  Lines: 86 ):
Code: Pascal  [Select][+][-]
  1. ...
  2. function CreateFile(
  3.     lpFileName            : LPCSTR;
  4.     dwDesiredAccess       : DWORD;
  5.     dwShareMode           : DWORD;
  6.     lpSecurityAttributes  : PSECURITY_ATTRIBUTES;
  7.     dwCreationDisposition : DWORD;
  8.     dwFlagsAndAttributes  : DWORD;
  9.     hTemplateFile         : THandle): THANDLE;
  10.     stdcall; external 'kernel32.dll' name 'CreateFileA';
  11.  
  12. function SetFilePointer(
  13.     hFile                : THandle;
  14.     lDistanceToMove      : Longint;
  15.     lpDistanceToMoveHigh : Pointer;
  16.     dwMoveMethod         : DWORD): DWORD;
  17.     stdcall; external 'kernel32.dll' name 'SetFilePointer';
  18.    
  19. function WriteFile(
  20.     hFile          : THANDLE;
  21.     const lpBuffer ;
  22.     nBytesToWrite  : DWORD;
  23.     nBytesWritten  : DWORD;
  24.     lpOverlapped   : POverlapped): BOOL;
  25.     stdcall; external 'kernel32.dll' name 'WriteFile';
  26.    
  27. function CloseHandle(
  28.     hObject: THANDLE): BOOL;
  29.     stdcall; external 'kernel32.dll' name 'CloseHandle';
  30. ...
  31.  
  32. function PutToFile(const AFileName: LPCSTR; AData: LPCSTR): Boolean;
  33. var
  34.     hFile    : THandle ;
  35.     count    : Cardinal;
  36.     dataSize : Integer ;
  37.    
  38.     overlap  : POverlapped;
  39.     dummy    : DWORD;
  40.     error    : DWORD;
  41. begin
  42.     result   := false;
  43.     dataSize := strlen(AData);
  44.  
  45.     hFile := CreateFile(
  46.         AFileName,              // name of the file
  47.         GENERIC_WRITE,          // open for writing
  48.         FILE_SHARE_READ or FILE_SHARE_WRITE,
  49.         nil,                    // default security
  50.         OPEN_EXISTING,
  51.         FILE_ATTRIBUTE_NORMAL,  // normal file
  52.         0);
  53.  
  54.     if hFile = INVALID_HANDLE_VALUE then
  55.         hFile := CreateFile(
  56.         AFileName,
  57.         GENERIC_WRITE,
  58.         FILE_SHARE_READ or FILE_SHARE_WRITE,
  59.         nil,
  60.         CREATE_NEW,
  61.         FILE_ATTRIBUTE_NORMAL,
  62.         0);
  63.  
  64.     if hFile = INVALID_HANDLE_VALUE then begin
  65.         MessageBox(0,
  66.         'file: fpc_rtl.$$$ could not be write.',
  67.         'Error', 0);
  68.         ExitProcess(1);
  69.     end else begin
  70.         dummy := MessageBox(0,
  71.         'CreateFile() success',
  72.         'Information', 0);
  73.         dummy := SetFilePointer(hFile, 0, nil, FILE_END);
  74.         error := GetLastError;
  75.        
  76.         if ((dummy = INVALID_SET_FILE_POINTER) and (error = NO_ERROR)) then begin
  77.             dummy := MessageBox(0,
  78.             'SetFilePointer() failed.',
  79.             'Information', 0);
  80.             ExitProcess(1);
  81.         end else begin
  82.             dummy := MessageBox(0,
  83.             'SetFilePointer() success.',
  84.             'Information', 0);
  85.  
  86.             // next step will crash the app ...            
  87.             dummy := WriteFile(hFile, adata, dataSize, 0, overlap);
  88.             error := GetLastError;
  89.            
  90.             if error <> 0 then begin
  91.                 dummy := MessageBox(0,
  92.                 'WriteFile() failed.',
  93.                 'Information', 0);
  94.                 ExitProcess(1);
  95.             end else begin
  96.                 dummy := MessageBox(0,
  97.                 'WriteFile() success.',
  98.                 'Information', 0);
  99.             end;
  100.         end;
  101.     end;
  102.     if CloseHandle(hFile) = 0 then begin
  103.         MessageBox(0,
  104.         'CloseHandle() failed.',
  105.         'Information', 0);
  106.         ExitProcess(1);
  107.     end else begin
  108.         MessageBox(0,
  109.         'CloseHandle() success.',
  110.         'Information', 0);
  111.     end;
  112.     result := true;
  113. end;

The Windows Event-Manager informations:

Code: Text  [Select][+][-]
  1. Name der fehlerhaften Anwendung: test1.exe, Version: 0.0.0.0, Zeitstempel: 0x00000000
  2. Name des fehlerhaften Moduls: KERNELBASE.dll, Version: 10.0.22000.2538, Zeitstempel: 0x06aca232
  3. Ausnahmecode: 0xc0000005
  4. Fehleroffset: 0x00000000000436a6
  5. ID des fehlerhaften Prozesses: 0x126c
  6. Startzeit der fehlerhaften Anwendung: 0x01da918f7f387e6f
  7. Pfad der fehlerhaften Anwendung: E:\Projekte\fpc-qt\src\tests\test1.exe
  8. Pfad des fehlerhaften Moduls: C:\Windows\System32\KERNELBASE.dll
  9. Berichtskennung: 49a6db74-6df0-48a3-826e-e91fa755d3ed
  10. Vollständiger Name des fehlerhaften Pakets:
  11. Anwendungs-ID, die relativ zum fehlerhaften Paket ist:


Code: Text  [Select][+][-]
  1. Fehlerbucket 1618690818384502278, Typ 4
  2. Ereignisname: APPCRASH
  3. Antwort: Nicht verfügbar
  4. CAB-Datei-ID: 0
  5.  
  6. Problemsignatur:
  7. P1: test1.exe
  8. P2: 0.0.0.0
  9. P3: 00000000
  10. P4: KERNELBASE.dll
  11. P5: 10.0.22000.2538
  12. P6: 06aca232
  13. P7: c0000005
  14. P8: 00000000000436a6
  15. P9:
  16. P10:
  17.  
  18. Angefügte Dateien:
  19. \\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER.5c5edd71-2b2b-4832-8c5b-b2cf4f035be0.tmp.mdmp
  20. \\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER.faae124b-6e7f-42c6-a17a-f01d67568972.tmp.WERInternalMetadata.xml
  21. \\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER.8fc3d2a3-2465-4bfe-af8a-bc15652b274c.tmp.xml
  22. \\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER.004145ae-92e1-4c88-b286-846b8a8b58bc.tmp.csv
  23. \\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER.e0cab7c6-f5a0-41f4-9732-ffe854851d5f.tmp.txt
  24. \\?\C:\Users\Jens Kallup\AppData\Local\Temp\WER.1184a3db-b2c7-4500-9e00-9a0535dd23a9.tmp.appcompat.txt
  25.  
  26. Diese Dateien befinden sich möglicherweise hier:
  27. \\?\C:\ProgramData\Microsoft\Windows\WER\ReportArchive\AppCrash_test1.exe_394953599d258270cfaf83e132644a308f9bc680_2464b88d_7dcbcb3f-6da5-4e11-88e7-191298723d04
  28.  
  29. Analysesymbol:
  30. Es wird erneut nach einer Lösung gesucht: 0
  31. Berichts-ID: 49a6db74-6df0-48a3-826e-e91fa755d3ed
  32. Berichtstatus: 268435456
  33. Bucket mit Hash: 390f7a4d1c943737e676beb91efe9e06
  34. CAB-Datei-Guid: 0
4
Beginners / Re: Find child controls by name
« Last post by Handoko on Today at 03:01:47 pm »
Is there a reason to use string helper method instead of upcase ()?

It is more about personal choice. I prefer to put the component at the beginning followed by action. For example: CustomerSave, CustomerEdit,  DataLoad, DataClose.

And I am sure many users will agree with me, pressing a dot is easier than 2 brackets. You can try, type a pair of brackets while both eyes are closed. Can you? I can't.
5
General / Re: Linux Workspaces -- StayOnTop?
« Last post by QEnnay on Today at 02:40:24 pm »
Thanks, but as I mentioned "sticky" is making it work. I just tested "sticky" on another laptop that is using Wayland (dev version) and it works on both.

Clearly it is doable, just not with FPC/Laz  then?
6
FPC development / Re: what to do if my target MIPS cpu has no FPU
« Last post by Key-Real on Today at 02:35:34 pm »
yes, but is there not allready a .inc file in the rtl for thouse types
7
FPC development / Re: what to do if my target MIPS cpu has no FPU
« Last post by Thaddy on Today at 02:34:25 pm »
You scale integers....
8
Hello..
I'll give you the link to a video on YouTube on how to install it on Ubuntu 22.04. The method is the same for Linux Mint. I'm sure it can help you

https://www.youtube.com/watch?v=HrcTVG1CW9I
9
Beginners / Re: [Solved] Find child controls by name
« Last post by cdbc on Today at 02:28:56 pm »
Hi
@KodeZwerg: +1
@Joanna:
Quote
If I remember correctly, more than one unnamed control will also be interpreted as duplicate names.
NO, You remember wrong! If the controlname is empty = '' = nil etc. it is ignored, only when you assign something to the name, it has to be unique to the container.
Regards Benny
10
Beginners / Re: [Solved] Find child controls by name
« Last post by KodeZwerg on Today at 02:21:13 pm »
As you all probably know, duplicate names cause a crash. If I remember correctly, more than one unnamed control will also be interpreted as duplicate names.
Than all my dynamic created controls would fail and crash since I never assign a name to them, but hey, they dont.
Maybe the reason is that a handle is the master and not a name.
A name I just assign if I need to store some (unique) info and have no other possibility left.
Pages: [1] 2 3 ... 10

TinyPortal © 2005-2018