Jump to content

mvanrijnen

Members
  • Content Count

    495
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by mvanrijnen

  1. mvanrijnen

    Strange behaviour Windows VCL app on specific laptop

    Sorry, no problem still exists after that.
  2. mvanrijnen

    Strange behaviour Windows VCL app on specific laptop

    Drivers updates (as well the Intel as the nVidia drivers) Forced the app to work with the Intel GPU (does this work if the app is launched from a "launch app" instead of the explorer?)
  3. mvanrijnen

    Console application - CRT Unit - Console Library

    See: Keyboard identifiers and input method editors for Windows | Microsoft Learn United States-International 00020409 In Ply.Types.pas change TKeyboardLayout from Word to Longword, now is the wrong type. TKeyboardLayout = LongWord; // Word;
  4. mvanrijnen

    Console application - CRT Unit - Console Library

    When i start the move_window demo, i get this effect: (same with other demo's as wel)
  5. mvanrijnen

    Console application - CRT Unit - Console Library

    yes, my library back then, poked right into the videomemory. clocking the windowing functions with a analog stopwatch from my father, checking if i could find somewhere to speed the things up. (my father thought i was somekind of idiot, clocking the timing of putting thousands of random rectangles on the screen 🙂, but then he also was scared when i took his 8000$ company laptop apart 🙂 )
  6. mvanrijnen

    Console application - CRT Unit - Console Library

    nice, for some apps/usecases console beats windows apps. somewhere i have some progressbar code for console also. back at the time i also had a "Painter" application, with which you can design "Screens", export them to ASCI/ANSI, TurboPascal CRT, etc. i get a range check error, on the minimalconsole app demo? Function tConsole.GetKeyboardLayout : TKeyboardLayout; Var pwszKLID : Array [0..KL_NameLength] of Char; begin FillChar(pwszKLID,sizeof(pwszKLID),#0); if (GetKeyboardLayoutNameW(pwszKLID)) then begin FKeyboardLayout := StrToInt('$'+StrPas(pwszKLID)); end else begin FKeyboardLayout := _KeyboardLayout_de_DE; end; Result := FKeyboardLayout; end; On the strtoint('$'+ .... line (pwszKLID = ('0', '0', '0', '2', '0', '4', '0', '9', #0 #0)
  7. Hello, I just had to work on a project for the first time in D11.3, it uses TRestclient against the MSGRaph API. Now i'm getting error 12029, probably some TLS problem, anyone got a quick solution? Tried, .SecurityProtocols := [TLS12, TLS13] etc. not working Running on Windows 11 (21H2), updating to 22H2 right now.
  8. pff found it, there was a proxy server forced in debug mode.
  9. During the Execute of the post to get the token. 'https://login.microsoftonline.com/[clientname].onmicrosoft.com/oauth2/v2.0/token'
  10. mvanrijnen

    search between two dates

    I always use DateOf when assigning a TDate to a date field in a sql query. It's sometimes hard to know if somehow a time part was added to a date value. So just to be sure i do a lot of: (especially when the TDate field/param is in a SQL select statement) procedure DoMyUpdate(const AMyDateParameter : TDate); begin qry.ParamByName('MyDateParameter').AsDate := DateOf(AMyDateParameter); ... end; or if needed (eg in a loop) extract the Date value outside the loop: procedure DoMyUpdate(const AMyDateParameter : TDate); var myRealDateVar : TDate; begin myRealDateVar := DateOf(AMyDateParameter); while i<cnt do begin .... .... qry.ParamByName('MyDateParameter').AsDate := myRealDateVar; inc(i); ..... end;
  11. mvanrijnen

    Is there a Sunday between 2 dates ?

    working on it:) (wait for a batchjob to finish 🙂 so, can play around) UWE's method seems okay though
  12. mvanrijnen

    Is there a Sunday between 2 dates ?

    needs a check for friday-monday
  13. mvanrijnen

    Is there a Sunday between 2 dates ?

    Yes, just experiented in Excel 🙂 pseudo: (DaysBetween(D2, D1) div 7) + ifthen(DayOfTheWeek(D1)=daySunday,1,0) ) + ifthen(DayOfTheWeek(D2)=daySunday,1,0) hmz, one off in some cases. pseudo (2): sundaycount := (DaysBetween(D2, D1) div 7); if (DayOfTheWeek(D1)=daySunday) or (DayOfTheWeek(D2)=daySunday) then sundaycount = sundaycount + 1; back to the drawing board 🙂
  14. mvanrijnen

    Delphi REST frameworks that run on Linux?

    MARS is also (according to: MARS-Curiosity REST Library - Delphi-PRAXiS [en] (delphipraxis.net)) compatible with linux, it seems to work on all Delphi targets so.
  15. mvanrijnen

    Delphi REST frameworks that run on Linux?

    Things like: * RadServer * MARS
  16. Yes would be nice if they changed this to store it at project level. Would like to see this for the debug watches also.
  17. Yes on the last dutch Delphi event from EMB (via Bransten) this was said to. Also they said that EMB is busy with an update so existing MDI apps will still run & function correctly. (i think they gonna implement the parts which MS dropped). see also":
  18. mvanrijnen

    Delphi / TCP/IP Server

    besides the threadsafety and the question if this is the best solution, probably your memo is getting "full", try to limit the total lines in the memo to for example max. 1000lines, and do the update between beginupdtae and endupdate. With which intensivity the clients send data )(e,.g. 100 times per second)? function TFServer.cliInfoMessage(info: TMemo; send, msg: string): Boolean; begin TThread.Queue(nil, procedure begin info.lines.BeginUpdate(); try info.Lines.Append('/' + send + '/' + msg); while info.lines.count>1000 do info.lines.delete(0); finally info.lines.EndUpdate(); end; end); result := true; end;
  19. mvanrijnen

    Delphi / TCP/IP Server

    I'm reasonably sure that you can accomplish this with Indy. You have multiple clients sending data to a single indy server i assume? Maybe you have some memory problems, not correct handling incoming connections and or data?
  20. Would be a possibility for the parts that don't touch/need our BL indeed.
  21. Still running production with the DEV Console, we are (for sure 90%) moving away from RadServer, It gives us no pro's/extra's only problems and con's. We're looking at something like MARS to develop our (micro)services.
  22. mvanrijnen

    File Search

    @programmerdelphi2k I believe the findclose needs to be executed when the findfirst succeeds, otherwise not.
  23. mvanrijnen

    File Search

    and if you stay with the findfirst/findnext solution, do not forget the findclose 🙂
  24. mvanrijnen

    File Search

    TStringDynArray, i believe its defined in the unit "System.Types". you call this function for example with: FindFilesWithPatttern('C:\MyFolder', '*.sys'); // get all the .sys files FindFilesWithPatttern('C:\MyFolder', 'myfile.txt'); // get the myfile.txt file(s) (maybe for your example u should use an overload of the TDIrectory.GetFiles method which also recurs over the (sub)folders. the line: files := TDirectory.GetFiles(directoryPath, filePattern); you change in: files := TDirectory.GetFiles(directoryPath, filePattern, TSearchOption.soAllDirectories); for that. As said before by someone else, a filemask can also be a full filename.
  25. mvanrijnen

    File Search

    The "ChatGPT" solution: Question: uses System.SysUtils, System.IOUtils; procedure FindFilesWithPattern(const directoryPath, filePattern: string); var files: TStringDynArray; fileName: string; begin try files := TDirectory.GetFiles(directoryPath, filePattern); for fileName in files do Writeln(fileName); except on E: Exception do Writeln('An error occurred: ' + E.Message); end; end; Explanation from ChatGPT:
×