Jump to content

mvanrijnen

Members
  • Content Count

    489
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by mvanrijnen

  1. mvanrijnen

    Indy IMAP and Microsoft EWS

    Read and implement the required steps one by one: Get access without a user - Microsoft Graph | Microsoft Learn
  2. Hi, Having a problem with an inherited control of TGroupBox/TCustomGroupBox the line var GroupBox := Control as TCustomGroupBox; in following Vc;.StdCtrls method goes wrong (Invalid typecast); The inherited control worked always in previois delphi versions, now are we gonna get a lot of problems like this? Other people stumbled up on this problem with inherited controsls? Better, someone knows how to quickly work around this problem? the code from vcl.stdctrl (D11.2): [edit] hmz, in a clean project it works, going to dig some more procedure TGroupBoxStyleHook.Paint(Canvas: TCanvas); var R, CaptionRect: TRect; Details: TThemedElementDetails; SaveIndex: Integer; LStyle: TCustomStyleServices; begin LStyle := StyleServices; if not LStyle.Available then Exit; PaintBackground(Canvas); CaptionRect := GetCaptionRect(Canvas); var GroupBox := Control as TCustomGroupBox; if GroupBox.ShowFrame then R := GetBoxRect(Canvas); if Control.Enabled then Details := LStyle.GetElementDetails(tbGroupBoxNormal) else Details := LStyle.GetElementDetails(tbGroupBoxDisabled); SaveIndex := SaveDC(Canvas.Handle); try ExcludeClipRect(Canvas.Handle, CaptionRect.Left, CaptionRect.Top, CaptionRect.Right, CaptionRect.Bottom); if GroupBox.ShowFrame then LStyle.DrawElement(Canvas.Handle, Details, R); finally RestoreDC(Canvas.Handle, SaveIndex); end; DrawControlText(Canvas, Details, Text, CaptionRect, Control.DrawTextBiDiModeFlags(DT_VCENTER or DT_CENTER)); end;
  3. fixed .... Was a trick for the custom component to paint like a GroupBox, so the GroupBoxStyleHook was registred for it. Made an own stylehook, and now it works 🙂
  4. Glad Remy made it clear for you not to send JSON. I totally forgot about that 😉
  5. // Line breaks for legibility only POST /{tenant}/oauth2/v2.0/token HTTP/1.1 Host: https://login.microsoftonline.com Content-Type: application/x-www-form-urlencoded client_id=11111111-1111-1111-1111-111111111111 &scope=user.read%20mail.read &code=OAAABAAAAiL9Kn2Z27UubvWFPbm0gLWQJVzCTE9UkP3pSx1aXxUjq3n8b2JRLk4OxVXr... &redirect_uri=http%3A%2F%2Flocalhost%2Fmyapp%2F &grant_type=authorization_code &client_secret=jXoM3iz... // NOTE: Only required for web apps No JSON
  6. I think you do not need to send JSON, take a look here: https://learn.microsoft.com/en-us/graph/auth-v2-user#3-get-a-token We do this (found on the internet), it's for TRestclient, but you can see how the body is composed : url := TURI.Create('http://localhost'); url.AddParameter('grant_type', 'refresh_token'); url.AddParameter('refresh_token', RefreshToken); url.AddParameter('client_id', ClientID); url.AddParameter('client_secret', ClientSecret); paramBody := LRequest.Params.AddItem; paramBody.Value := url.Query; paramBody.Kind := pkREQUESTBODY; paramBody.Options := [poDoNotEncode]; paramBody.ContentType := TRESTContentType.ctAPPLICATION_X_WWW_FORM_URLENCODED;
  7. ah, found them myself: from: Editing the Configuration of Your RAD Server Engine Manually - RAD Studio (embarcadero.com)
  8. Can you post an example of the section? Somehow we do not have it on our config at all?
  9. ah ok, maybe missing some DLL's or wrong versions of DLL's? * What we also do as test, is run the emsdevserver for the BPL on the IIS machine. (we were able to find/fix some problems with this) * Use procmon for get a view on which files are trying to be loaded, filter out the right process, view only files, look for errors on opening fils: Process Monitor - Windows Sysinternals | Microsoft Learn. I know on Radserver is hard to debug this kind of things, there is no logging of what goes wrong. I have read about enabling debugfile in the emsserver.ini but never found out how this works. (very bad documentation)
  10. mvanrijnen

    Using Delphi Rest Components

    mitm is also a localapp.
  11. mvanrijnen

    Using Delphi Rest Components

    i use mitm proxy a lot, not a specific rest proxy, but you can see all the data flowing: mitmproxy - an interactive HTTPS proxy (mostly i use a compiler directives to force proxy use of my software, for debugging purposes, sometimes a confusion on monday mornings then, if you forget to start the proxy 🙂)
  12. you could try fiddling with the SynchronizedEvents property REST.Client.TCustomRESTClient.SynchronizedEvents - RAD Studio API Documentation (embarcadero.com)
  13. mvanrijnen

    HoursBetween

    i use about the same method in our planner (with a timeoffset and a flexible interval (as setting for the user)). function TframeEditFromTill.ComboToTime: TTime; begin Result := TimeOf(IncMinute(0, TimeOffSet + (cmbTimeTo.ItemIndex*EditTimeInterval))); end; * TimeOffSet is a integer property, just to have the possibility to force a mininum time * EditTimeInterval is a integer property, the interval in minutes e.g. 5, 15, 30
  14. mvanrijnen

    DelphiMVCFramework-3.2.2-nitrogen has been released

    gonna give it a try, with a small private project. btw bough the cookbook 😉
  15. Had the same with clipboard (CTRL-C, CTRL-V, CTRL-X) in D10.xx etc, often exceptions with the rightclick-mouse method, always working through the IDE main menu. very very weird, have made rsp's in the paste about this kind of things, but have giving up hope about it. Maybe it get's fixed when we start paying 10times the price of Delphi as we do now, seems that the current price range is not high enough to garantee a reasonable working product.
  16. mvanrijnen

    DelphiMVCFramework-3.2.2-nitrogen has been released

    Okay, looks very interesting, do people here at the forum have experiences with it ? Is it usable for production?
  17. We went from sending mail through smtp (office365) to the MS Graph interface. Basically, some rest services authenticated with OAUTH2 (register application in azure director), and sending message with json. (simple messages can go in 1 call, messages with big attachments take a bit more work). So with MSGRaph you can send as user with the user authenticating with OAUTH2, of send it from a registered application with clientid&secret etc. etc. user: sendMail - Microsoft Graph v1.0 | Microsoft Docs
  18. mvanrijnen

    any body can write this code by delphi?

    ..... or you ask Remy 🙂
  19. mvanrijnen

    any body can write this code by delphi?

    In that case, the code is not that difficult, as a Delphi developer you have to be able to do this for 99,9% on your own. So make your own code in Delphi, see if it works, if it doesn't, then post that Delphi code here for reviewing/tips/improvements.
  20. mvanrijnen

    any body can write this code by delphi?

    you gonna need more then that code translated to delphi, Probably there will be some authentication/authorisation) things needed before you can post your data. ah, another WhatsApp api, see here tuturioals enough for other languages: WhatsApp API gateway for sending messages and chatbot - Ultramsg
  21. mvanrijnen

    How to force update to label during a loop

    Try .ApplyStyleLookup
  22. Hi,just curious. Anyone experience with using PostgreSql in the cloud (eg google for example), for use in a Windows Desktop application? (have a small app, and the persons using it would like to use it on multiple locations, so i am looking for an easy way out 🙂.)
  23. yes, i already use only SSL, but i think i go another way. I'm thinking of writing a custom server (using e.g. MARS framework), and then use a service like ngrOK to expose the services. only figure out how to keep it 100% private, put a certificate or something with secrets in it.
  24. I know, but it's just a very small app (semi hobby). Besides that, i wonder if its so not done to go that direction (with which i basicly fully agree), why there are so many providers, exposing databases as a "cloudservice"? Other question, what would be the best way to make rest services available for a smapp app, (low cost), save and secure ? (at work we use radserver and all kinds of dedicated servers, firewalls, proxy's, certificates etc etc, can not do that for this small projetc) Without having to administer webservers, certificates etc. (somekind of appliance i can start in the cloud, upload a dll or cgi/isapi module and publish webservice, private&secure) (developed with Delphi, eg. MARS as rest framework)
  25. I discovered there are some more PostgreSQL cloud providers (dedicated or shared). I'm testing with one now, looks ok right now. (i want to prevent rewriting the app to using rest api's etc, instead of querying the DB directly),
×