Jump to content

mvanrijnen

Members
  • Content Count

    455
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by mvanrijnen

  1. mvanrijnen

    Delphi Coding Boot Camp 2023

    i think that posting was not necessary, as our mailboxes are flooded with announcements of them.
  2. mvanrijnen

    Some REST help please.

    As far as i know it's widely accepted to put the data in a put/post request as json in the body.
  3. mvanrijnen

    Some REST help please.

    Why could a POST not be a port of a REST API interface?
  4. mvanrijnen

    Trouble with resource path

    did you register the resource class?
  5. mvanrijnen

    Issue with TMenuBar and Alt key

    I once dived into this (FMX) and the click is just "swallowed" somewhere, in the deep grounds of FMX. Can't remember clearly, but i might have created an topic about it @embarcadero.
  6. I have a simple resource. Unit filename: Resource.Company.WebHookReceiver.pas type [Path('CompanyWebhookReceiver')] TCompanyWebhookReceiver = class public [Post, Consumes(TMediaType.APPLICATION_JSON)] function Bucket([BodyParam] body : string): string; end; {$IFDEF DEBUG} [Get, Produces(TMediaType.APPLICATION_JSON)] function BucketGet([BodyParam] body : string): string; {$ENDIF} (in the get i call the same methods as in the post, this is for debugging purposes) When i use this in the cmd bootstrap it works, i call it by: http://localhost:8099/rest/default/CompanyWebhookReceiver/ I get the result i want. Then i use the same units in the ISAPI bootstrap, i call it then by: http://localhost:8085/company/WebHookReceiver_ISAPI.dll/rest/default/CompanyWebhookReceiver/ Result: Resource [CompanyWebhookReceiver] not found What am i doing wrong? [edit] In the Server.ignition.pas i have the following line: // Application configuration FEngine.AddApplication('DefaultApp', '/default', ['Resource.Company.*']); [edit2] I put an output to file in the initialization section of the resources unit, and the text is written.
  7. mvanrijnen

    Resource works in CMD not in ISAPI

    found it 🙂 Placed the wrong ini (wrong filename) beside the dll. (duh)
  8. mvanrijnen

    Project Options -> Version Info aka. dproj madness

    yes, we are working on that also.
  9. mvanrijnen

    Project Options -> Version Info aka. dproj madness

    Yes, i always have to set the version multiple times also in the IDE, Would be nice if there was an apply to child configs (All->Win32->Release/Debug) etc. Or better a checkbox with a Single Version option, which then makes sure the version is applied to all configs.
  10. I have a tool for that, (not tested with the different SMB version yet). (when the scanner can smtp or ftp) You can setup a simple virtual ftp and/or smtp server with it, In the configuration you can determine which ftp folder or fake smtp emailaddress goes to another protocol, e.g SMBvx, secure ftp, secure smtp, office365 etc etc. (tool needs some work to go public) The tool is named: ProtoBridge Of course this is a tool which would never be directly connected to the internet. configuration example: // Common Settings [general] queuefolder=e:\Data\MyCompany\ProtoBridge ;discardhandledmessage=false discardhandledfiles=true debug=false // IP accesslist [acl] allowed=172.16.29.4,172.16.29.41,172.16.29.42,172.16.29.249,172.16.29.250,192.168.1.3,192.168.1.4,192.168.1.15,192.168.1.16,172.16.29.170,172.16.29.153,172.16.29.37,172.16.29.38,172.16.29.104,172.16.29.131,192.168.1.18 ;blocked=127.0.0.1 // setup virtual smtpserver [smtpserver] smtp_listenip=172.16.29.4,192.168.1.18 smtp_listenport=25 //emails not catced with targets are send trough with smpt config smtppassthrough smtppassthrough=smtp.ict@company allowpipelining=true // setup virtual ftpserver [ftpserver] enable=false ip=127.0.0.1 port=21 pasvstart=7000 pasvend=7999 ;user=myftpuser ;password=myftppassword // setup real smtp account, O365 in this case [smtp.ict@company] discardhandledfiles=true smtp_servertype=office365oauth2 smtp_username=ict@company.eu smtp_from=ict@company.eu oauth2_tenantname=company.onmicrosoft.com oauth2_applicationid=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx oauth2_clientsecret=XXXXXxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx // possible conversions: localfolder, smb, smtp2localfolder, smtp2smb, ftp2localfolder, ftp2smb, ftp2smtp, ftp2smtp, smtp2smtp //catch smtp recipient 'localfolder@smtp.local' and put the files to c:\temp\company\smtprelay\localfolder [target.localfolder] targettype=localfolder folder=c:\temp\company\smtprelay\localfolder catchto=localfolder@smtp.local //catch ftp folder 'myftpfolder' and put the files to c:\Temp\company\LocalFolder\Username\X ;[target.myftpfolder] ;targettype=ftp2localfolder ;folder=c:\Temp\company\LocalFolder\Username\X ;;fileexist=deny, overwrite, rename - default overwrite ;fileexist=rename //catch ftp folder 'myftpfolder2' and put the files to c:\Temp\company\LocalFolder\Username\2 // [target.myftpfolder2] targettype=ftp2localfolder folder=c:\Temp\company\LocalFolder\Username\2 //catch ftp folder 'myftpfolder3' and send tje files to Username@company.nl using smtpconfig smtp.ict@company [target.myftpfolder3] targettype=ftp2smtp smtp=smtp.ict@company smtp_to=Username@company.nl discardhandledfiles=true
  11. mvanrijnen

    Strange behaviour Windows VCL app on specific laptop

    Sorry, no problem still exists after that.
  12. 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?)
  13. 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;
  14. 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)
  15. 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 🙂 )
  16. 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)
  17. 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.
  18. pff found it, there was a proxy server forced in debug mode.
  19. During the Execute of the post to get the token. 'https://login.microsoftonline.com/[clientname].onmicrosoft.com/oauth2/v2.0/token'
  20. 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;
  21. 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
  22. mvanrijnen

    Is there a Sunday between 2 dates ?

    needs a check for friday-monday
  23. 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 🙂
×