delphi-xe4

Cannot remove `Null Characters` from a string

ⅰ亾dé卋堺 提交于 2019-12-07 17:05:51
问题 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 :=

Detect if string contains a float?

时光毁灭记忆、已成空白 提交于 2019-12-07 15:15:30
How can I detect if a string contains a float. For example: '0.004' But without using StrToFloat because that function are slow but rather by iterating through chars. function IsInteger(const S: String): Boolean; var P: PChar; begin P := PChar(S); Result := True; while not (P^ = #0) do begin case P^ of '0'..'9': Inc(P); else Result := False; Break; end; end; end; This will check if string is a positive integer but not a float.. I would use TryStrToFloat(): if TryStrToFloat(str, value, FormatSettings) then .... If you are prepared to use the default system wide format settings then you can omit

Error opening a dfm file - Class xxxx not found

廉价感情. 提交于 2019-12-07 15:13:35
While opening a dfm file by double clicking, I am getting following error: Class TMyClass not found. Ignore the error and continue? Note: Ignoring the error may cause components to be deleted or property values to be lost. When I click Cancel, I get following message Error creating form: Class TMyClass not found. When I click OK now, pas file is opened only. In pas file MyClass unit is added (which conatins the TMyClass defination) and its path is also added in my search path (Ctrl clicking on unit name, takes me to the unit file) Everything is fine as per me. I don't know why I am getting

XE4/FireDAC uADStanCipher not found error

心不动则不痛 提交于 2019-12-07 14:17:33
When I try to compile my XE4/FireDAC project I receive the following error: [dcc32 Fatal Error] uADPhysSQLiteCli.pas(992): F1026 File not found: '<project path>\uADStanCipher.dcu' I have searched for solutions and it seems that the file is not distributed with the standard FireDAC installer due to export restrictions. Some Google results refer to the link http://cc.embarcadero.com/item/29376 . It appears that the link should allow you to download the correct file. Unfortunately I receive an Unavailable Submission error. I am a fully registered user of XE4. Has anybody found a solution to this

Unicode in Delphi form TRectangle TText

假如想象 提交于 2019-12-07 08:45:53
问题 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

Creating specific Custom TListBoxItem with given example and trouble with fontColor property

人走茶凉 提交于 2019-12-07 07:10:25
问题 Can someone please guide me in the right direction. I am attempting to create a Custom ListboxItem using Delphi XE4 for a iOS application. My goal output would be something along the lines of the photo above, where as I am currently stuck here (image below). I have been successful at dynamically generating a ListBoxItem and inserting an TLabel object, however, I am unable to change the 'fontColor' property of the TLabel to a desired color. I can code TLabel.Fontcolor := ClaBlue; But the color

Delphi XE4 FireMonkey TMemo Transparent? (iOS)

馋奶兔 提交于 2019-12-07 03:20:57
问题 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... 回答1: 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; 回答2: You need to

Which midas.dll to use? 32bit datasnap/64bit server

痞子三分冷 提交于 2019-12-06 14:16:00
Considering the following: We have a 32 bit Datasnap server installed on a 64 BIT Windows Server In embarcadero\rad studio\11.00\redist are 2 folders : 32 bit and 64 bit, with in each a midas.dll. Wich file should we put where? In windows\system32 or windows\syswow64 ? Never put anything in the Windows system directories (unless you have a very, very, very good reason to write there). It's a very bad practice (dating back to Windows 3.x times and poor developers skills, because those dirs are always in the search path) just leading to troubles (i.e. if another application chnages your DLL with

XE4 Firemonkey on iOS prevent sleep mode

蓝咒 提交于 2019-12-06 08:19:38
问题 I am developing an app in Firemonkey XE4 for iOS and need to prevent the device from sleeping when there is no user input. I have found this command for xcode development: [application setIdleTimerDisabled:YES]; I presume there is an equivalent in FMX? Can anyone help please? Thanks Darryl 回答1: You can go straight to UIApplication, as so: uses iOSapi.UIKit; {$R *.fmx} procedure TForm6.Button1Click(Sender: TObject); var UIApp : UIApplication; begin UIApp := TUIApplication.Wrap(TUIApplication

How can I add an extra http header using IHTTPNegotiate?

混江龙づ霸主 提交于 2019-12-06 05:11:30
问题 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