Lajos Juhász
-
Content Count
846 -
Joined
-
Last visited
-
Days Won
11
Posts posted by Lajos Juhász
-
-
Why is file2 a widestring?
You should try:
procedure TForm1.Button1Click(Sender: TObject); var byte1: TBytes; file2: string; LJSONObject: TJSONObject; base64: TBase64Encoding; begin if OpenDialog1.Execute then begin /// / begin encodein base64 byte1 := System.iOUtils.TFile.ReadAllBytes(OpenDialog1.FileName); base64 := TBase64Encoding.Create(0); // CharsPerLine = 0 means no line breaks try file2 := TNetEncoding.base64.EncodeBytesToString(byte1); finally base64.Free; end; var Client := TRESTClient.Create('https://api.ultramsg.com/instance16802/messages/image'); var request := TRESTRequest.Create(nil); var esponse := TRESTResponse.Create(nil); request.Client := Client; request.Response := esponse; Client.ContentType := 'application/x-www-form-urlencoded'; request.Method := TRESTRequestMethod.rmPOST; LJSONObject := TJSONObject.Create(); try LJSONObject.AddPair('token', 'xxxxxx'); LJSONObject.AddPair('to', '+00000000'); LJSONObject.AddPair('image', file2); request.AddBody(LJSONObject); request.Execute; Memo1.Text := request.Response.Content; finally LJSONObject.Free; end; end; end;
-
MyCariable:=trunc(MyCariable*100)/100;
-
10 minutes ago, KMarb said:Delphi 11.1, creating android apps
In researching other topics I found some discussion that android is a different beast in terms of memory management, and maybe we should no longer call free or freeAndNil?
This was correct until Delphi 10.4 when ARC ( Automatic Reference Counting) was removed. Now you code the same way on all of the platforms and have to call free or if you must call freeAndNil (freeAndNil is in 99.999999999999999999% a code smell.)
-
17 minutes ago, Rollo62 said:n the webinar Q&A Marco Cantu was confirming that this update is binary compatible to the last version and that this was deeply tested before release.
He also mentioned that there are some corner cases where it's not and he believes that we should not have those cases. Best is to recompile everything.
- 1
-
This logic most probably belongs to the field's onchange.
-
The hotkey doesn't have to be the first character. A better solution is to set the AutoHotkeys property of the popup menu to maManual. If that's not possible you can use the StripHotkey function from Vcl.Menus to remove the &.
-
According to the Delphi 11 feature matrix that's a Architect/Enterprise feature. I cannot check out for Delphi 10.4 but believe it's the same.
-
27 minutes ago, Denis Dresse said:Thanks for this links,
but it do not adresses the TRichEdit.SelText problematic, which transform the "Courier New" font, when some special characters are given to SelText (ex : ═ alt 205 et ─ alt 196...)
Denis
I quick google search returned this one: https://devblogs.microsoft.com/math-in-office/richedit-font-binding/
I have to warn you that this is a bug in MS Richedit implementation. I've entered into Microsoft Word using Courier New 11 ──────────────────────────────. No problem there, then copied to the clipboard and pasted to Wordpad.exe the result wordpad changed the font to Segoe UI Symbol 11. -
Why not use the OnMoved event of the splitter?
-
1 minute ago, David Heffernan said:Easier to replace the CRT monitor with an LCD
Do you get burn-in with LCD?While LCDs are not susceptible to burn-in the same way CRT monitors are, LCDs suffer from what manufacturers call image persistence. Like the burn-in on CRTs, image persistence on LCD monitors is caused by the continuous display of static graphics on the screen for extended periods.
(I am not going to test this on my monitor) -
I would do something like this:
var ws: TWindowState; l: TRect; begin ws:=WindowState; l:=BoundsRect; try if ws=wsMaximized then WindowState:=TWindowState.wsNormal; SetBounds(l.Left+1, l.Top+1, l.Width, l.Height); Repaint; Sleep(100); finally WindowState:=ws; if ws<>TWindowState.wsMaximized then SetBounds(l.Left, l.Top, l.Width, l.Height); repaint; end; end;
-
25 minutes ago, alank2 said:One is UTF8ToUnicodeString, but I don't see its reverse which I would have expected to possibly be UnicodeStringToUTF8 ?
It's https://docwiki.embarcadero.com/Libraries/Alexandria/en/System.UTF8Encode.
-
In this case Fetchoptions doesn't make a difference. in order to do a client side filter the computer has to load all the data and then can filter out the requested records.
- 1
-
Most probably you're loading 1.7GB data into the memory (you can verify using task manager). Insted of a client side filter you should do a server side.
-
For me it's happening for about a year maybe a bit longer, before that I used the registry entry for years without a problem.
-
If you really want to use TWebBrowser you must set FEATURE_BROWSER_EMULATION before using the component (Windows is going to remove it from the registry constantly). Of course this is only a short term solution as IE is dead.
-
I didn't started this thread. I just don't care anymore when something doesn't work in the IDE. I already failed to make a test case for more interesting bugs.
I just like to use my time in a more productive way.
-
3 hours ago, Roger Cigol said:It would be interesting to know if the same problem exists on 11.1 - does anyone have time to check this ?
There are problems with ctrl+click to open files in D11.1 I didn't checked the RSP. (We can only hope that the beta testers will fill enough bug report on this issue and it will be fixed in the next versions. Dear beta testers the future of the Delphi community is in your hands).
-
In the older version TDBImage didn't supported anything but bitmaps. That's why we used TEDBImage (there are also other sources still floating on the internet how to handle multiple formats in a blob stream).
-
You can read the protected leftcol property of the grid:
type
TCrackDBGrid = class(TDBGrid);TCrackDBGrid(DBGrid1).LeftCol
will return the first column of the screen.
-
Usually this happens when you install a faulty package to the IDE. Try to uninstall every third party components.
You can also try to start the IDE with a new registry key using the -r command line switch (https://docwiki.embarcadero.com/RADStudio/Alexandria/en/IDE_Command_Line_Switches_and_Options).
-
10 hours ago, Remy Lebeau said:The question was about the SQUARE brackets (Attribute), not the ANGLE brackets (Generic).
I know I was tired and english is not mother tongue that's the reason why I later removed my original post.
-
The relative path should be ..\SharedCode\FileUtils.pas.
I opened a dpr and dproj for an application and there the paths are relative.
-
Edit. Sorry it's late.
- 1
post image base64 to whatsapp api
in Network, Cloud and Web
Posted
// CharsPerLine = 0 means no line breaks