Jump to content

DelphiUdIT

Members
  • Content Count

    612
  • Joined

  • Last visited

  • Days Won

    11

Everything posted by DelphiUdIT

  1. DelphiUdIT

    D12 CatalogRepository Problem!

    I have some getit packages in private Repo (like Styles and FastReport) and others in common Repo (like Parnassus, FmxLinux).
  2. DelphiUdIT

    D12 CatalogRepository Problem!

    In the offline Rad Studio installer you can set those path before start the install process.
  3. DelphiUdIT

    D12 CatalogRepository Problem!

    Sorry for the inaccuracy but I wrote quickly:
  4. DelphiUdIT

    D12 CatalogRepository Problem!

    Why don't you set your new path for CatalogRepo ? In TOOL menu you can set you own path for that. And if that path need to be the same for all user every user can do the same. I have mine own path to a more accessible folder. It's simple and better also when you migrate the IDE.
  5. DelphiUdIT

    {$define} broke the IDE :)

    In Delphi 11, when I changed some $IFDEF a lot of time the source code not changed. But the compile (full compile, not RUN hoping that IDE compile the right code) always does the correct work. In Delphi12, by now, changing $IFDEF always change the source code too. I use some $DEFINE and I never notice malfunctions.
  6. May be, now is working, like the example in the Embarcadero unit .... but there are some facets to evaluate. program Project2; {$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils; type IFoo = interface ['{5DEC09C5-FADC-46A5-814F-9ED91259A37F}'] function GetEmptyName: string; function GetFooName: string; end; IBar = interface(IFoo) ['{5DEC09C5-FADC-46A5-814F-9ED91259A37F}'] function GetBarName: string; end; //TFooBar = class(TInterfacedObject, IBar) //This is working too TFooBar = class(TInterfacedObject, IFoo, IBar) function GetEmptyName: string; function GetFooName: string; function GetBarName: string; end; function TFooBar.GetEmptyName: string; begin Result := 'Empty'; end; function TFooBar.GetFooName: string; begin Result := 'Foo'; end; function TFooBar.GetBarName: string; begin Result := 'Bar'; end; var i: IInterface; begin try { TODO -oUser -cConsole Main : Insert code here } i := TFooBar.Create; Writeln((i as IFoo).GetEmptyName); Writeln((i as IFoo).GetFooName); Writeln((i as IBar).GetBarName); except on E: Exception do Writeln(E.ClassName, ': ', E.Message); end; readln; end.
  7. Uhmmm for me it's not working, but maybe I'm missing something... I'm almost certain that the "as" and "is" don't work if the GUIs are identical...
  8. I agree with you, I just wanted to point out some sources on where to possibly look for further useful information on the topic. I've already seen double GUIDs in interfaces in COM environments, and they worked correctly (or at least I never detected problems), but I never looked into them further.
  9. You must use GUIDs when there is a need to use RTTI "as" and "is". Like you told, each interface should have a unique GUID, but I have already see that. Start from here: https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Object_Interfaces_(Delphi) (may be the link is wrong ... wiki is down at the time of writing) P.S.: You can read also these books (with examples) - Hodges Nick - Coding in Delphi (year 2013) - Hodges Nick - More Coding in Delphi (year 2015) I don't know if there are something that can help you ...
  10. DelphiUdIT

    Getit out of service

    Yes since Friday evening.
  11. If the system is overloaded all activities and processes including threads, events, etc ... will inevitably be delayed. To mitigate this you can just "play" with the thread priority. Using sleep in a thread at a higher priority than normal is usually a satisfactory solution. However, if the timer needs to be triggered (i.e. it is not always active), then you should use sleep in combination with a WaitFor. As @Dalija Prasnikar says, it is not possible to provide you with further solutions if you do not present code or delve deeper into the topic.
  12. DelphiUdIT

    Run in new desktop

    Uhmm ... you used a wrong words .... for me is "many times", not "few times" , 4 times I went in the lock screen. Like you wrote, something about Windows 11 is wrong. I cannot help 'cause I have not experience in this case. I never used CreateDesktop or similar api. Good luck and let us knows if you'll resolve the question.
  13. DelphiUdIT

    How can I make TTimer run in the main tread ?

    To be more exact as possible you can use MMSystem: timeBeginPeriod(1); timeEndPeriod(1); These affect the timer resolution in Windows ... in this example the resolution is set to milliseconds between timeBeginPeriod and timeEndPeriod. You can find more information on: https://learn.microsoft.com/en-us/windows/win32/api/timeapi/nf-timeapi-timebeginperiod. You can set (timebegin) at the start of application and reset (timeend) at the end. P.S.: normally this is the accuracy ... thanks to Mark: https://learn.microsoft.com/it-it/sysinternals/downloads/clockres
  14. DelphiUdIT

    How can I make TTimer run in the main tread ?

    I use PlaySound in async way (and with more then 10 seconds) in all my applications without any issue. I use it with RESOURCE identifier, but with old app I used also with media file. PlaySound('Alarm_Sound', HINSTANCE, SND_RESOURCE OR SND_ASYNC);
  15. DelphiUdIT

    Run in new desktop

    Terrible 😱 ... in Windows 11 23H2 that produce a black screen with application, but when you close the application there is no way (or better, I don't know how) to come back to previous Desktop ... close some process, launch new explorer ... all shortcuts ... only shutdown and restart Windows (from Task Manager -> "New operation") ... also everything I launch is not visible, may be is attached to old Desktop ... This is a good and simple hacking app ...
  16. DelphiUdIT

    How can I make TTimer run in the main tread ?

    Like most events, the OnTimer event executes on the main thread. It might be what you do in the OnTimer procedure that is "asynchronous" and the procedure "OnTimer" exits before the async operations complete.
  17. DelphiUdIT

    Run in new desktop

    If you think the functions are "failing" try testing their return parameter and detect the "getlasterror" to see if there are more precise indications.
  18. I'm not aware of those. I have some applications that call PING and TCP alternate, thousands of times a day to various devices (over the Internet), and I have no such error reports. And they are applications that run for years without ever being turned off. They use TIdICMP (for ping) (WIN32 version) and are multithread applications but all the PINGs are running only from one thread.
  19. May be you can use the ARP protocol ... finding MAC Add is its function: Uses WinApi.Winsock2, WinApi.IpHlpApi, WinApi.IpExport; procedure TForm1.Button1Click(Sender: TObject); var DestIP, SrcIP: IPAddr; AddrLen: ULong; MacAddr: array[0..5] of byte; s: AnsiString; i: integer; begin SrcIp := 0; s := '192.168.2.10'; //ROTATE IP DestIP := inet_addr(PAnsiChar(s)); AddrLen := SizeOf(MacAddr); SendARP(DestIP, SrcIP, @MacAddr[0], AddrLen); s := ' MacAddress : '; if AddrLen > 0 then for i := 0 to AddrLen-1 do begin s := s + IntToHex(MacAddr[i], 2) + '-'; end; SetLength(s, length(s)-1); ShowMessage(s); end;
  20. DelphiUdIT

    Debugger gives wrong value for long double

    Have you tried the math package RudysBigNumbers https://github.com/TurboPack/RudysBigNumbers ? It's in Getit too.
  21. No, you can use Lazarus / FPC but you must rewrite your application. Before that you must be sure that they support last Android SDK.
  22. It's useless. Lazarus approach to Android is totally different from FMX. You must rewrite all your code. And I don't know if last Android api level 33 are supported ...
  23. There is not only a problem of the length of the "pointers" but also of the arrangement of the data within the record. The compiler "fills" the record structure with zero bytes to align the data to the defined alignment (which can be the standard one or one defined in that section of code). Therefore, the transmission of that data (whatever it is) is still at risk even if it were performed within programs made with Delphi. A change of alignment (even the standard one) for example between different platforms or different compiler releases could lead to different results.
  24. I haven't seen any blogs or public news about Rad 12 Beta (Yukon) yet (except directly from Embarcadero). This is the link where Dave reports some important news: https://delphiworlds.com/2023/09/yukon-is-coming/
  25. "MS_SMART_CARD_KEY_STORAGE_PROVIDER" is useless with smartcard. All the smartcards I have used are not read through that provider, but only through their own provider, which can be listed via CNG (CryptoApi Next Generation). So far I've only used Common Name (CN) access without using the password key for my purposes, and I was planning to move forward to specifically use a smartcard with Indy (but obviously it could work for ICS too). But time is running out and I don't know when I will be able to continue.
×