delphi-xe4

Cannot remove `Null Characters` from a string

谁说胖子不能爱 提交于 2019-12-06 03:55:48
I asked a similar question couple months ago. Thanks to Rob Kennedy I could load my whole text into a Richedit BUT I couldn't remove Null chars . I could load my text because I used Stream . Now in this code: var strm : TMemorystream; str : UTF8string; ss : TStringstream; begin strm := tmemorystream.Create; try strm.LoadFromFile('C:\Text.txt'); setstring(str,PAnsichar(strm.Memory),strm.Size); str := StringReplace(str, #0, '', [rfReplaceAll]); //This line doesn't work at all ss := tstringstream.Create(str); Richedit1.Lines.LoadFromStream(ss); finally strm.Free; ss.Free; end; end; I converted

Unicode in Delphi form TRectangle TText

自闭症网瘾萝莉.ら 提交于 2019-12-05 14:09:13
I'm new to Delphi & in DelphiXE4 editor I am trying to make chessboard gui on form, using x64 TRectangle for board (alternate colors). I want to add unicode chess pieces but in ObjectInspector properties when I add unicode it displays literally on the form. How can I add Unicode to TText (so the form displays unicode as chess pieces)? (After I want to add dragndrop to TRectangles/unicode chess-any ideas?). Rectangle63: TRectangle; Rectangle64: TRectangle; Text1: TText; Text2: TText; Here is screenshot showing problem: I'm most grateful for help, thanks EDIT: Jeroen's answer worked to solve

Delphi TThread under ARC (iOS) not being released

前提是你 提交于 2019-12-05 13:13:45
问题 What is a proper way to terminate a thread using Delphi for iOS under ARC management? Take this simple example: TMyThread = class(TThread) protected procedure Execute; override; public destructor Destroy; override; end; TForm2 = class(TForm) Button1: TButton; Button2: TButton; Button3: TButton; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); procedure Button3Click(Sender: TObject); private FThread: TMyThread; public end; { TMyThread } destructor TMyThread

Delphi XE4 FireMonkey TMemo Transparent? (iOS)

允我心安 提交于 2019-12-05 06:17:41
Is there any way to make the TMemo transparent in Delphi/iOS/FireMonkey? I don't see any way to edit styles myself when selecting + right-clicking the memo control... Try removing memo's background on applying style event. procedure TForm1.Memo1ApplyStyleLookup(Sender: TObject); var BckObject: TFmxObject; begin BckObject := Memo1.FindStyleResource('background'); if Assigned(BckObject) and (BckObject is TSubImage) then begin TSubImage(BckObject).Source := nil; end; end; You need to change the style of the control you want to display transparent as you want. Unfortunately Embarcadero does not

Using ParseSQL Command for ADO Parameters Cause Invalid Parameter DataType

自作多情 提交于 2019-12-04 17:33:12
I have some SQL Command that contains a parameter such:(Note that myID has "int" type in SQL) vSqlString :='Select * From myTable Where myID= :paramID'; and Use ParseSQL Command to execute this command: myADOQuery.Parameters.ParseSQL(vSqlString , True); Now myADOQuery.Parameters.ParamByName('paramID').DataType is smallint Type and it can't accept negative integer values. I can exactly show to compiler that my Parameter[0].DataType is ftIneteger and it works properly, but what is a good solution for this problem? Mohammad Gohari My question is asked by Mr. imanShadabi Here: Using TAdoQuery

How can I add an extra http header using IHTTPNegotiate?

陌路散爱 提交于 2019-12-04 11:26:51
How can I add an extra header to the request using IHTTPNegotiate? I added the interface but functions BeginningTransaction & OnResponse never get called. TNameSpaceHandler = class(TComObject, IInternetProtocol, IHttpNegotiate) ... function BeginningTransaction(szURL, szHeaders: LPCWSTR; dwReserved: DWORD; out szAdditionalHeaders: LPWSTR): HResult; stdcall; function OnResponse(dwResponseCode: DWORD; szResponseHeaders, szRequestHeaders: LPCWSTR; out szAdditionalRequestHeaders: LPWSTR): HResult; stdcall; ... end; I'm silently assuming you're intercepting traffic by both implementing

How to monitor Pipeline stages in OmniThreadLibrary?

↘锁芯ラ 提交于 2019-12-04 09:20:08
Is it possible to monitor Pipeline tasks somehow? I tried to add monitors to each task like this FPipeline := Parallel.Pipeline() .Stage(StageWorker1, Parallel.TaskConfig.MonitorWith(MyMonitor)) .NumTasks(MaxReadThreadCount) .Stage(StageWorker2, Parallel.TaskConfig.MonitorWith(MyMonitor)) .Run(); but getting the exception "Task can be only monitored with a single monitor" (as I understand, it happens because the internal hidden monitor is already installed for pipeline stages). Use Parallel.TaskConfig.OnMessage and provide a common message processing function. FPipeline := Parallel.Pipeline()

creating a firemonkey component

雨燕双飞 提交于 2019-12-04 05:56:37
问题 I'm working with Firemonkey in Delphi XE4 and I'm unable to create a new component using the menu item Component -> New Component. Whether the component is a VCL or Firemonkey component or whether I create a package first the result is the same. The Tool Palette in Delphi appears to be searched and gradually it closes leaving it empty of components and a component dialog box that says "No Items available" when it comes to selecting an ancestor component. I have two separate installations of

How to adjust button size to fit the text in Delphi FireMonkey?

谁都会走 提交于 2019-12-04 03:48:24
I want button size (width and height) to be as small as possible, but I want it to fit the text. Any code example? Delphi XE4 FireMonkey Mobile Application. FireMonkey renders text via methods using TTextLayout class. We can access this methods via a class helper and then change the buttons size based on the information provided by the layout. uses FMX.TextLayout; type TextHelper = class helper for TText function getLayout : TTextLayout; end; function TextHelper.getLayout; begin result := Self.fLayout; end; procedure ButtonAutoSize(Button : TButton); var bCaption : TText; m : TBounds; begin

Is a separate Delphi XE4 license required for a build machine?

不想你离开。 提交于 2019-12-03 16:11:54
For building applications via dcc32 onto build server I could use Delphi Trial. There wasn't any problems with licenses for such approach. Now, I am going to use building Delphi XE4 applications onto TeamCity via msbuild . Do I need to have a separate license Delphi XE4 reguired for a build machine? Thank you in advance! From the license.rtf file distributed with XE4: 2.4. Command Line Compiler. Licensee may install the command line compiler on a separate computer from the Product itself, provided that the sole purpose of doing so is to allow that computer to perform unattended building of