

mvanrijnen
Members-
Content Count
494 -
Joined
-
Last visited
-
Days Won
1
Everything posted by mvanrijnen
-
Try .ApplyStyleLookup
-
Postgresql in the cloud, possible for Desktop App?
mvanrijnen posted a topic in Network, Cloud and Web
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 🙂.) -
Postgresql in the cloud, possible for Desktop App?
mvanrijnen replied to mvanrijnen's topic in Network, Cloud and Web
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. -
Postgresql in the cloud, possible for Desktop App?
mvanrijnen replied to mvanrijnen's topic in Network, Cloud and Web
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) -
Postgresql in the cloud, possible for Desktop App?
mvanrijnen replied to mvanrijnen's topic in Network, Cloud and Web
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), -
Sending Email via GMail Using OAuth 2.0 via Indy
mvanrijnen replied to Ugochukwu Mmaduekwe's topic in Indy
got it working, just a reminder for people struggling with the large attachments and getting an invalid Content-Range header error: instead: hdr := 'bytes 0..199/200'; // example value MyRequest.AddParameter('Content-Range', hdr, TRESTRequestParameterKind.pkHTTPHEADER); use: MyRequest.AddParameter('Content-Range', hdr, TRESTRequestParameterKind.pkHTTPHEADER, [TRESTRequestParameterOption.poDoNotEncode]); (took only a few hours struggling 🙂, putting a proxy behind it, and see it in 1 minute )/ -
How can I move a window to the left edge of a monitor?
mvanrijnen replied to dummzeuch's topic in VCL
following, same here, told the users to live with it for now 🙂 a solution would be nice. -
Sending Email via GMail Using OAuth 2.0 via Indy
mvanrijnen replied to Ugochukwu Mmaduekwe's topic in Indy
ah, ok. did not had a change to try it. but we decided to go over to use the MS Graph API for outgoing emails. (as we can configure which email sending mechanism our sending services use, so could also be reverted back to smtp when needed). -
Sending Email via GMail Using OAuth 2.0 via Indy
mvanrijnen replied to Ugochukwu Mmaduekwe's topic in Indy
Yes, so i mixed up some things. I was using OAuth2 as user identification, so with the login username/password and MFA authentication, then i got the token and logged in with that token. As i'm adapting some service applications, we have to use client_secret So i'm using the code from @Geoffrey Smith as starting point. I'v adapted it and i get a access token now, with the client_secret (grantype client_credentials), only thing is that the idSMTP.Authenticate does not authenticate with the returned access token. (Authentication unsuccessfull). some hints would be great ! 🙂 maybe i gonna try the sasl-oauth branch from @Remy Lebeau, but i'm a little scared that i then get all kinds of bumps to get another indy branche working. (but i will try this out). btw, is i use the access token generated by method with user/passw + 2fa, then i can send with smtp, found out why i have no success: on the doc page, where they explain smtp oauth2 with client_credentials; Authenticate an IMAP, POP or SMTP connection using OAuth | Microsoft Docs -
Sending Email via GMail Using OAuth 2.0 via Indy
mvanrijnen replied to Ugochukwu Mmaduekwe's topic in Indy
Ok, i have a question, in this case i adapted our sending servers to use oauth. We are using office365/exchange online. But the clientsecrets generated in the Azure AD (AppRegistrations), what use are they? * I only have to use the application-id, and an account+password to generate the token. This generated token i put in a config for later use, but in the method i use now, the clientsecrets are never used? -
var oldevent : TNotifyEvent; begin oldevent := myComponent.OnExit; try myComponent.OnExit := nil; ..... your code here ... finally myComponent.OnExit := oldevent ; end; end; maybe expand the oldevent scope some more if you want to reassign in another method.
-
Yes, i use this one for a planner app we developed (inhouse use). No problems so far, ofcourse somehtings are sometimes slight different, but those guys know what their doing,
-
To Whom It May Concern: Deprecation of Basic authentication in Exchange Online
mvanrijnen posted a topic in Network, Cloud and Web
I thought some of you might be interested in this: https://docs.microsoft.com/en-us/exchange/clients-and-mobile-in-exchange-online/deprecation-of-basic-authentication-exchange-online -
ShowModal does not show window after a few tries (It does not pop up)
mvanrijnen replied to ChrisChuah's topic in VCL
I tried it with 2 almost empty forms in D11.1, with same method as TS, but the modalform stays appearing on top, after 50 times. Is TS using a specific componentset ? or does the subform do something with z-order ? (i last had some troubles with a specific componentset in D11.1 on Win11, where i had 2 click the closebutton of the "child" form twice to close, but they fixed that) ah, read over the styles part, try that also here now. -
ShowModal does not show window after a few tries (It does not pop up)
mvanrijnen replied to ChrisChuah's topic in VCL
From the manual: " caFree The form is closed and all allocated memory for the form is freed. " @TS, Maybe, maybe, FDetailForm.SetZOrder(True) would help. if i remeber there's also a winapi call to reset/refresh zorder of windows, i'll try to find that. (but big question is still why form goes behind mainform after couple of times) -
ShowModal does not show window after a few tries (It does not pop up)
mvanrijnen replied to ChrisChuah's topic in VCL
See this in the OP: In the Form Close of the TfrmAircraftTypesNew, i will have Action := caFree; -
Not personal, but there is a reason why we use a webbrowser instead of a TV set. I like to read this kind of things instead of watching YT 😉 (just a comment)
-
FireDAC - TFDQuery - How to default calculated fields in the dataset to ReadOnly=False
mvanrijnen replied to JonathanW's topic in Databases
Is not what the TP indicates with glhis post, what you post is not the question. You suggest first let the DB do it's work, retrieve that result, and on client side, overwrite that result with a clientside calculation? -
FireDAC - TFDQuery - How to default calculated fields in the dataset to ReadOnly=False
mvanrijnen replied to JonathanW's topic in Databases
You'd better add calculated fields to the dataset, and use the OnCalcFields event. That way you can locally do then calculations, Use a slight different fieldname for the locally calculated, or same and don't fetch the calculated fields in the query. -
Best to remember position instead of displaynumber (and windowmode (maximized or not)). You also want to check if the position you set your form on still is visible, user could have disconnect a display for instance., so you can make sure your app is visible on startup.
-
Community Edition expiring again, no new keys
mvanrijnen replied to Nigel Thomas's topic in Delphi IDE and APIs
Yes, they have to put in a licensing model like VisualStudio, free to use (free version same as cheapest commercial version), and from a revenue of USD xxxxxxx (fill in a number), then you start paying. (okay, have to figure out internal licenses for internal development) How bigger the community the bigger the paying licenses, but give the people a full unrestricted product. -
class operator TRectF.Add
mvanrijnen replied to Gustav Schubert's topic in RTL and Delphi Object Pascal
System.Types, causes this, strange, TRectF not designed to handle negative numbers?: function TRectF.IsEmpty: Boolean; begin Result := (Right <= Left) or (Bottom <= Top); end; so the next one returns just an empty rect: function UnionRectF(out Rect: TRectF; const R1, R2: TRectF): Boolean; var tmpRect: TRectF; begin tmpRect := R1; if not R2.IsEmpty then begin if R2.Left < R1.Left then tmpRect.Left := R2.Left; if R2.Top < R1.Top then tmpRect.Top := R2.Top; if R2.Right > R1.Right then tmpRect.Right := R2.Right; if R2.Bottom > R1.Bottom then tmpRect.Bottom := R2.Bottom; end; Result := not tmpRect.IsEmpty; if not Result then begin tmpRect.Top :=0.0; tmpRect.Bottom := 0.0; tmpRect.Left := 0.0; tmpRect.Right := 0.0; end; Rect := tmpRect; end; -
sending text between applications (10)
mvanrijnen replied to jbWishmaster's topic in ICS - Internet Component Suite
Interesting, gonna take a look at (into) this solution, maybe we use this route also. -
sending text between applications (10)
mvanrijnen replied to jbWishmaster's topic in ICS - Internet Component Suite
4). Write a little program which logs the IP in a database (with a lastseen timestamp) 5). Write central service to which the clients report every x minutes/hours. (we do that here now, maybe going over to MQTT for reporting this stuff, we use this also for servicing a win32 app (3cx, with own build plugin) to automaticly dial phonenr's from our software, through the service we are also able to find out if we need to use the phone next to the station or another phone (eg when using RDP to use the application, this service is the crossing point of knowledge of IP nr's, stations who using RDP, and the linenumbers of the phsyical phones, (yes the phonenr's are fixed to the physical phone) * The client app reports IP, RDP and application info * The 3cx plugin reports also IP and phoneline nr * Client app sends to service callnr "xxxxxxxxxxx", service send to the specific 3cx instance, to dial the number). Maybe, using something like MQTT works for you also, plenty components available for Delphi. Only have to setup a MQTT service somewhere in your network (server). -
TidHTTP [SSL], SSL errors is production, not in developement
mvanrijnen posted a topic in Network, Cloud and Web
* Same executing code * Made sure i have the same OpenSSL Dll's * Made sure calling the same URL In production i get the following exception: EIdOSSLUnderlyingCryptoError : Error connecting with SSL. error:1408E0F4:SSL routines:SSL3_GET_MESSAGE:unexpected message In the development environment it works perfectly (ofcourse 🙂 ). Anyone any idea, what could be the problem here ? My code for creating the idhttp component: procedure THSJSonApiClient.InitHTTP; begin fhttp := TIdHTTP.Create(nil); if UseSSL then begin fopenssl := TIdSSLIOHandlerSocketOpenSSL.Create(nil); //fopenssl.SSLOptions.Method := sslvSSLv23; fopenssl.SSLOptions.VerifyMode := []; fopenssl.SSLOptions.VerifyDepth := 0; fopenssl.SSLOptions.SSLVersions := [sslvTLSv1_2, sslvTLSv1_1, sslvTLSv1]; fopenssl.PassThrough := False; fhttp.IOHandler := fopenssl; end; fhttp.handleredirects := True; {$IFDEF DEBUG} flog := TIdLogEvent.Create(nil); flog.ReplaceCRLF := False; flog.LogTime := False; flog.Active := True; flog.OnReceived := CatchLogReceived; flog.OnSent := CatchLogSent; flog.OnStatus := CatchLogStatus; fhttp.Intercept := flog; {$ENDIF} end;