Delphi

How to save a memo as unicode

对着背影说爱祢 提交于 2021-01-28 03:43:54
问题 I am using Delphi 7, How can I save a Memo as a Unicode text file, I find some example for save it as UTF-8 text file, but I need an example for saving file as unicode. Thanks for any help 回答1: You need to use a control that supports Unicode. Delphi 7 TMemo does not. Which means that your real problem is not so much saving the content, but admitting the content in the first place. You should deal with this by switching to the TNT Unicode components. Once you start using the TNT Unicode

Can I restrict (compile or runtime) a generic to being an array [0..n] of char

守給你的承諾、 提交于 2021-01-28 03:30:36
问题 I have a program with a lot of structures defined as static arrays of char and records (usually consisting of arrays of char, but that's not so important). I am trying to create a generic interface for these structures, so they can be passed to a back-end C DLL. I am able to handle all types of records by using the <T: record> constraint, but array[0..n] of char falls foul of the 'non-nullable value type' rule. I can use unconstrained generics by declaring types for my different static arrays

TMediaPlayer Error - Unsupported Media File

﹥>﹥吖頭↗ 提交于 2021-01-28 03:23:19
问题 I am trying to play a mp3 file from Firemonkey XE7 windows application. It should have been a simple task by putting a TMediaPlayer component, assigning it a .mp3 file, and just playing it. However, I get the following error: Application Error Exception EReadError in module MediaPlayerTest.exe at 00000000000012139E. Error reading MediaPlayer1.FileName: Unsupported media file testfile.mp3. I have also tried .wav, and it didn't work either. (Audio codec have already been installed and the media

How can I host a FireMonkey form client aligned inside another?

无人久伴 提交于 2021-01-28 03:15:31
问题 My Delphi XE7 FireMonkey project is growing controls and naturally I've moved to using frames. Where I've used frames in the VCL there have been situations where I've simply chosen to host one (complex) VCL form inside another instead, creating and displaying it in the form's OnShow and setting it client-aligned (the benefit of this is that you don't get issues with dangling inherited controls when you edit the frame). With FireMonkey though, things have changed slightly and my attempt to get

How to get frame delay from animated gif?

三世轮回 提交于 2021-01-28 03:13:17
问题 I try resize animated gif. I resize each frame as bitmap and then make new animated gif but I don't know how to get frame delay for same speed animation as in original gif. uses Gifimg; procedure TForm1.FormCreate(Sender: TObject); var gif: TGIFImage; bmp,bmp2: TBitmap; i:integer; gifren: TGIFRenderer; gif2:TGifImage; begin gif:=TGIFImage.Create; gif2:=tgifimage.Create; bmp:=TBitmap.Create; bmp2:=TBitmap.Create; gif.LoadFromFile('d:\z.gif'); gifren:=TGIFRenderer.Create(gif); for i:=0 to gif

Can I restrict (compile or runtime) a generic to being an array [0..n] of char

情到浓时终转凉″ 提交于 2021-01-28 02:14:11
问题 I have a program with a lot of structures defined as static arrays of char and records (usually consisting of arrays of char, but that's not so important). I am trying to create a generic interface for these structures, so they can be passed to a back-end C DLL. I am able to handle all types of records by using the <T: record> constraint, but array[0..n] of char falls foul of the 'non-nullable value type' rule. I can use unconstrained generics by declaring types for my different static arrays

How to trace service firebird

早过忘川 提交于 2021-01-28 02:12:24
问题 How to trace all events for service firebird server with delphi xe10? This is my code: my := TIBControlService.Create(Self); my.ServerName := '127.0.0.1/3050'; my.Protocol := TProtocol.TCP; my.LoginPrompt := false; my.TraceFlags := [tfQPrepare, tfQExecute, tfQFetch, tfError, tfStmt, tfConnect, tfTransact, tfBlob, tfService, tfMisc]; my.Params.Add( 'user_name=SYSDBA' ); my.Params.Add( 'password=masterkey' ); // ----- mh := MonitorHook; mh.TraceFlags := my.TraceFlags; Self.IBSQLMonitor1

IHTMLDocument2 and Internet Explorer 11 changes on Windows 7

纵然是瞬间 提交于 2021-01-28 00:15:57
问题 I use TWebBrowser to have HTML editor in my application and of course it depends on version of Internet Explorer installed. I noticed after installation of the brand new Internet Explorer 11 on Windows 7 that my editor has changed. Paragraphs no longer seem to have same HTML code. HTML generated before when I pressed enter key: <P> </P> HTML generated now: <P><BR></P> This gives me additional line in my editor which doesn't look right. <P> itself has a new line, <BR> is completely useless

Using CoInitialize in a Delphi thread

半世苍凉 提交于 2021-01-27 23:16:19
问题 I am using TIdHttp and TXMLDocument inside a thread in a Delphi program. Now I want to know: Do these classes use COM objects so I need to call CoInitialize and CoUninitialize in this thread? If yes, do I have to use these functions at the body of execute method or at all methods that use TIdHttp or TXMLDocument classes? 回答1: TIdHTTP has no COM dependency. TXMLDocument can have a dependency on COM. On Windows, out of the box it is a wrapper around Microsoft's MSXML ActiveX component, which

How to add and remove Android notification channels in Delphi Rio10.3.2

∥☆過路亽.° 提交于 2021-01-27 21:10:04
问题 I would like to implement multiple notification channels for Android on an FMX project. RAD 10.3.2 now provides some support for API >= 26 and a "fallback" notification channel is automatically created. Its default description is "Notification channel for Firebase" and I would like to change this description as well as to add some new channels. In RAD 10.3.2, the new Options/Application/Services parameters provide a "Default local notification channel Id" which, I suppose, is there to change