delphi-2010

IdHttp Post Method Delphi 2010

本小妞迷上赌 提交于 2019-12-08 07:59:40
问题 Like others before me, I'm having troubles using the IdHttp(Indy 10.5.5) component in Delphi 2010. The code works fine in Delphi 7: var XMLString : AnsiString; lService : AnsiString; ResponseStream: TMemoryStream; InputStringList : TStringList; begin ResponseStream := TMemoryStream.Create; InputStringList := TStringList.Create; XMLString :='<?xml version="1.0" encoding="ISO-8859-1"?> '+ '<!DOCTYPE pnet_imessage_send PUBLIC "-//PeopleNet//pnet_imessage_send" "http://open.peoplenetonline.com

Replacing a unicode character in UTF-8 file using delphi 2010

送分小仙女□ 提交于 2019-12-08 07:57:48
问题 I am trying to replace character (decimal value 197) in a UTF-8 file with character (decimal value 65) I can load the file and put it in a string (may not need to do that though) SS := TStringStream.Create(ParamStr1, TEncoding.UTF8); SS.LoadFromFile(ParamStr1); //S:= SS.DataString; //ShowMessage(S); However, how do i replace all 197's with a 65, and save it back out as UTF-8? SS.SaveToFile(ParamStr2); SS.Free; -------------- EDIT ---------------- reader:= TStreamReader.Create(ParamStr1,

GetDateFileModified for Daylight Savings Time

烈酒焚心 提交于 2019-12-08 04:50:24
问题 function DateTimeToFileTime(FileTime: TDateTime): TFileTime; var LocalFileTime, Ft: TFileTime; SystemTime: TSystemTime; begin Result.dwLowDateTime := 0; Result.dwHighDateTime := 0; DateTimeToSystemTime(FileTime, SystemTime); SystemTimeToFileTime(SystemTime, LocalFileTime); LocalFileTimeToFileTime(LocalFileTime, Ft); Result := Ft; end; function ExtractShortDate(ATimeIn: TDateTime): string; // Convert DateTime to short date string begin Result := FormatDateTime('mm/dd/yyyy', ATimeIn); end;

ADODataset: how to load XML (saved beforehand in DB in ADO schema) data without temporary files?

↘锁芯ラ 提交于 2019-12-08 04:36:08
问题 Warning: total rewrite. Scenario: I loaded some data from database on a TCustomADODataset descendant. After that, I saved this data on XML temp file (using TCustomADODataset.SaveToFile) to allow getting the XML data as a string and store it on a database table as text blob - it's an exports table. Another program (different from the one that stored the XML) will take that data, show the elements inside, and allow an user to select which element to import to the main database schema. Problem:

Conflict between Delphi and SQL server

冷暖自知 提交于 2019-12-08 04:26:10
问题 I have a Query that works in SQL Server as well but when i save it in ado query in delphi it doesn't work and stops with this error : Incorrect syntax near 'GO' But the below code is correct and has not any error . i was tested it in sql server . The below code is not Regular because i copy and past it from delphi . My Query : create function GetTedad(@pfcode INT, @pdcode INT) returns int as begin declare @Tedad int; select @Tedad= sum(t2.tedade_avalie) from Tbl_avalie_salon t2 where t2.FCode

Delphi 2010 DeHL Serialization XML and custom attribute : how it work?

北城余情 提交于 2019-12-08 00:00:28
I try to investigate DeHL with Delphi 2010 custom attribute and I get problem. TAppParamTest = class public User: string; Password: string; end; TAppParam = class private FTest: TAppParamTest; public constructor Create; destructor Destroy; override; property Test: TAppParamTest read FTest write FTest; end; this works well : when I serialize I have this <TAppParam xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:DeHL="http://alex.ciobanu.org/DeHL.Serialization.XML" DeHL:class="AppParam_unt.TAppParam" DeHL:refid="1"> <FTest DeHL:class=

GExpert's Replace Components Expert doesn't replace the text in the form file (*.dfm)

天涯浪子 提交于 2019-12-07 20:23:47
问题 I am using Delphi 2010 and GExperts stable release 1.35 I am testing the "Replace Components" expert. I add a main form and a secondary form. Each has three TEdits on it. I use the Replace Components Expert to replace all TEdits with TRzEdit. I Check the Replace all components on all forms of the project. It works, it replaces them all. However, it doesn't do anything to the DFM file. How do i make it replace those instances. If i save, compile, or rebuild, i get errors. If i try to view the

Delphi 2010 RTTI : Use TValue to store data

戏子无情 提交于 2019-12-07 18:11:44
问题 I would like to be able to use TValue to store Data in a TList<>. Like in : type TXmlBuilder = class type TXmlAttribute = class Name: String; Value: TValue; // TValue comes from Rtti end; TXmlNode = class Name: String; Parent: TXmlNode; Value: TXmlNode; Attributes: TList<TXmlAttribute>; Nodes: TList<TXmlNode>; function AsString(Indent: Integer): String; end; ... public ... function N(const Name: String): TXmlBuilder; function V(const Value: String): TXmlBuilder; function A(const Name: String;

TEdit onclick select all?

故事扮演 提交于 2019-12-07 16:44:39
问题 How to select all text of a TEdit1 whenever user click on it or click to select some text of it 回答1: How to select all text of a TEdit1 whenever user click on it Select Edit1 in the VCL editor and double-click on the OnClick event: procedure TForm13.Edit1Click(Sender: TObject); begin Edit1.SelectAll; end; You can also link this event to another control like a button. Select the button, choose and click on the V arrow to select an event you want to link. Now both Edit1.OnClick and Button1

JclMapi mapi general failure

ⅰ亾dé卋堺 提交于 2019-12-07 13:21:58
问题 I have the code: procedure TfrmMain.btnSendClick(Sender: TObject); var aMail: TJclEMail; begin aMail := TJclEMail.Create; Screen.Cursor := crHourGlass; try aMail.Recipients.Add('service@blabla.com'); aMail.Subject := '[IMPORTANT] blablba'; aMail.Body := 'text text text text'; aMail.Send(True); finally Screen.Cursor := crDefault; aMail.Free; end; end; This throws: MAPI Error: (2) "General MAPI failure" Any idea? ps: OS Windows 7 Outlook 2010 Delphi 2007 回答1: I have the same as you, just