Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 10/29/20 in all areas

  1. Roland Skinner

    Filter Exceptions expert and IOS / Android apps

    Hi. Ok, fixed in Linux (tested with Ubuntu 20.04.2). Get this exception message for Linux in Delphi, which should have had message "Error Message" (this could be a Delphi error; I noticed it also after disabling the exception expert the other day): MacOS (10.15.7) all good: iOS (13.7) working, but same issue as Linux: Android (10 - 64-bit) still fails: I trust this helps...
  2. Roland Skinner

    Filter Exceptions expert and IOS / Android apps

    Hi. No problem assisting. I've been using GExperts for probably 20 years; glad I can help out. This is Linux, with GExperts uninstalled: "Error Message": Division by Zero: Accessing Nil-pointer (calling ClassName on TObject variable): Now with GExperts installed and exception-expert enabled: Division by Zero: Accessing Nil-pointer: Then, in iOS (GExperts installed and expert enabled): Division by Zero: Accessing Nil-pointer: I'll report the errors with the message to Embarcadero. I actually came here looking about issues I have with the Linux debugger, to see if anyone else had experienced the problems I've noticed. I'll report these too. (For example, objects are displayed as pointer-addresses only, yet you can see their member-values in a popup-inspector.)
  3. Kryvich

    Need help with IDhttp and Thread

    Yes, it's possible. And just in case an user needs to stop the download, I added the corresponding button. Now there are 3 states: dsIdle, dsExecuted and dsStopped. Downloader.zip
  4. Remy Lebeau

    My custom component becomes NI>

    Run the component code in the debugger, and put a DATA BREAKPOINT on the pointer variable that is turning nil unexpectedly, and when the breakpoint is hit then look at the call stack to see who is setting the pointer to nil.
  5. dummzeuch

    Filter Exceptions expert and IOS / Android apps

    Yes, if they are in the current context. That should be no problem with constants declared in the system unit, but for other constants that might not be the case. Hm, thinking about it: I wonder whether this is still true for parts of the IDE that are not written in Delphi...
  6. Mahdi Safsafi

    IOTAProcess.ReadProcessMemory / .WriteProcessMemory

    ReadProcessMemory does an internal check at the end of the operation. If it fails an exception is thrown then. On the right road 🙂 No idea but I doubt if it was ... I mean ToolsApi documentation is very poor
  7. A.M. Hoornweg

    Find UDP Server

    The "clean" way would be to use Bonjour a.k.a. ZeroConf. https://en.wikipedia.org/wiki/Zero-configuration_networking It is a somewhat "standardized" way of announcing all sorts of services using UDP broadcasts. Companies like Apple use it for discovering wireless devices such as printers. A zeroconf implementation can be found in the Remobjects suite ( https://docs.remotingsdk.com/Clients/Concepts/ROZeroConf/ ) but after some googling I found an open source implementation as well ( https://github.com/deltics/delphi.libs/tree/master/bonjour ).
  8. Kryvich

    Need help with IDhttp and Thread

    Hi, @clubreseau @Remy Lebeau gave you everything you needed to finish the job. But OK, in the attachment to this message is a ready test application based on Remy's code, with the addition of a thread pool. Tested on Delphi CE. Downloader.zip
  9. Marat1961

    Multiple two UInt64 modulo

    Why is an assembler needed for this operation? If the code is used for example to generate a random number. var seed class: Int64; function of the TRandom64.Def class: Int64; to begin Result: = seed * 6364136223846793005 + 1442695040888963407; seed: = Result; end; then we need a 2 ^ 64 remainder of the products of two Uint64 numbers. To do this, it is enough to multiply two numbers and take the least significant number from the result. Since the leading part of the result is not used, it seems there is no difference which multiplication works signed or unsigned. I was tormented by vague doubts, I wrote several tests and found no difference. type T2Uin64 = record hi, lo: UInt64; end; procedure UMul64 (a, b: UInt64; var r: T2Uin64); asm MOV RAX, a MUL b MOV r.lo, RAX MOV r.hi, RDX end; procedure TForm2.Button2Click (Sender: TObject); const imax32 = Maxint; imax36 = UInt64 (Maxint) * 16; imax63 = 9223372036854775807; umax64 = 18446744073709551615; var a, b, m, c, d, r1, r2: UInt64; r: T2Uin64; begin a: = imax63; b: = 2; d: = umax64 - 1; c: = a * b; r1: = c div m; r2: = (a * b) div m; Assert (c = d); UMul64 (a, b, r); r2: = r.lo div m; d: = r.lo; Assert (d = c); a: = umax64; b: = 2; d: = umax64; c: = a * b; UMul64 (a, b, r); b: = umax64; c: = a * b; UMul64 (umax64, umax64, r); end; If you want to find the remainder again, there is no need to use an assembler. // r2: = (a * b) div m; mov rax, [rbp + 68 $] imul rax, [rbp + $ 60] xor edx, edx div qword ptr [rbp + $ 58] mov [rbp + $ 38], rax It's better than calling an assembler subroutine anyway, because it will be faster. The code becomes portable and will work in both 32-bit and 64-bit implementations and on any platform. In my opinion, optimizing using assembler will only hurt here.
  10. dummzeuch

    Tools API - Changing Key Assignment

    Ctrl+D is listed in the GExperts Keyboard Shortcuts expert as assigned to the action actFormatSource, so it's not an editor key binding but simply an action. And that means it's just a matter of finding that action and changing its keyboard shortcut to whatever you like. And the IDE is even helpful with an NTA (native tools api) call for this: function TGxActionBroker.GetIdeActionList: TCustomActionList; var NTAServices: INTAServices; begin Assert(Assigned(BorlandIDEServices)); NTAServices := BorlandIDEServices as INTAServices; Assert(Assigned(NTAServices)); Result := NTAServices.ActionList; Assert(Assigned(Result)); end; I leave the rest (enumerating the list and change the shortcut of the action as an exercise to the reader. 😉
  11. Roland Skinner

    Filter Exceptions expert and IOS / Android apps

    Hi again. Just realized I could test Android 32-bit for you too. Same device (Android 10 64-bit). It works: And working on a 32-bit device (Android 7 - 32-bit): Looks like it is just 64-bit Android now.
  12. Bill Meyer

    Tools API - Changing Key Assignment

    I hope someone can offer a solution, as I find some of the newly added shortcuts in Sydney conflict with some in my plug-ins.
  13. Lars Fosdal

    Having fun with Delphi

    @Attila Kovacs What about System.IOUtils.TPath.Combine?
  14. Marat1961

    Having fun with Delphi

    unit Uri; interface uses System.SysUtils; type PxUri = ^TxUri; TxUri = record private FScheme: string; FPort: Cardinal; FHost: string; FUserName: string; FPassword: string; FPath: string; FQuery: string; FFragment: string; public function Init(const Scheme, Path: string; Port: Cardinal = 0): PxUri; function Host(const Value: string): PxUri; function UserName(const Value: string): PxUri; function Password(const Value: string): PxUri; function Path(const Value: string): PxUri; function Query(const Value: string): PxUri; function Fragment(const Value: string): PxUri; function ToString: string; end; implementation function TxUri.Init(const Scheme, Path: string; Port: Cardinal): PxUri; begin Result := @Self; Self := Default(TxUri); FScheme := Scheme; FPath := '/' + Path; FPort := Port; end; function TxUri.Host(const Value: string): PxUri; begin Result := @Self; FHost := Value; end; function TxUri.UserName(const Value: string): PxUri; begin Result := @Self; FUserName := Value; end; function TxUri.Password(const Value: string): PxUri; begin Result := @Self; FPassword := Value; end; function TxUri.Path(const Value: string): PxUri; begin Result := @Self; FPath := FPath + Format('/%s', [Value]); end; function TxUri.Query(const Value: string): PxUri; begin Result := @Self; if FQuery = '' then FQuery := Format('?%s', [Value]) else FQuery := FQuery + Format('&%s', [Value]); end; function TxUri.Fragment(const Value: string): PxUri; begin Result := @Self; FFragment := Format('#%s', [Value]); end; function TxUri.ToString: string; var sb: TStringBuilder; begin sb := TStringBuilder.Create; try sb.Append(FScheme); sb.Append(':'); if FHost <> '' then begin sb.Append('//'); if FUserName <> '' then sb.AppendFormat('%s:%s@', [FUserName, FPassword]); sb.Append(FHost); if FPort <> 0 then sb.AppendFormat(':%d', [FPort]); end; sb.Append(FPath); if FQuery <> '' then sb.Append(FQuery); if FFragment <> '' then sb.Append(FFragment); Result := sb.ToString; finally sb.Free; end; end; end. procedure TForm2.Button1Click(Sender: TObject); var uri: TxUri; begin uri.Init('http', 'Mammalia', 8080) .UserName('yourname') .Password('TopSecret') .Host('www.website.com') .Path('Theria') .Path('Carnivora') .Path('Felidae') .Path('Lynx_pardinus') .Query('showall') .Query('yearstart=1990') .Fragment('StartReadingHere'); Label1.Caption := uri.ToString; end; http://yourname:TopSecret@www.website.com:8080/Mammalia/Theria/Carnivora/Felidae/Lynx_pardinus?showall&yearstart=1990#StartReadingHere 005FD859 68901F0000 push $00001f90 005FD85E 8D45D8 lea eax,[ebp-$28] 005FD861 B92CD95F00 mov ecx,$005fd92c 005FD866 BA4CD95F00 mov edx,$005fd94c 005FD86B E8C8F8FFFF call TxUri.Init 005FD870 BA64D95F00 mov edx,$005fd964 005FD875 E856F9FFFF call TxUri.UserName 005FD87A BA84D95F00 mov edx,$005fd984 005FD87F E874F9FFFF call TxUri.Password 005FD884 BAA4D95F00 mov edx,$005fd9a4 005FD889 E81AF9FFFF call TxUri.Host 005FD88E BAD0D95F00 mov edx,$005fd9d0 005FD893 E888F9FFFF call TxUri.Path 005FD898 BAECD95F00 mov edx,$005fd9ec 005FD89D E87EF9FFFF call TxUri.Path 005FD8A2 BA0CDA5F00 mov edx,$005fda0c 005FD8A7 E874F9FFFF call TxUri.Path 005FD8AC BA28DA5F00 mov edx,$005fda28 005FD8B1 E86AF9FFFF call TxUri.Path 005FD8B6 BA50DA5F00 mov edx,$005fda50 005FD8BB E8ECF9FFFF call TxUri.Query 005FD8C0 BA6CDA5F00 mov edx,$005fda6c 005FD8C5 E8E2F9FFFF call TxUri.Query 005FD8CA BA98DA5F00 mov edx,$005fda98 005FD8CF E8B8FAFFFF call TxUri.Fragment TestUri.pas.42: Label1.Caption := uri.ToString; 005FD8D4 8D55D4 lea edx,[ebp-$2c] 005FD8D7 8D45D8 lea eax,[ebp-$28] 005FD8DA E835FBFFFF call TxUri.ToString 005FD8DF 8B55D4 mov edx,[ebp-$2c] 005FD8E2 8B45FC mov eax,[ebp-$04] 005FD8E5 8B80D4030000 mov eax,[eax+$000003d4] 005FD8EB E8F446F4FF call TControl.SetText
×