delphi-2010

consuming web service with authentication allways give message Authentication required

孤街浪徒 提交于 2019-11-28 08:42:09
问题 I try to use consume one web service with Delphi 2010. This web service is on port 8000 with authentication. I implement the function TForm4.EncodeLoginPW(const ALogin, APW: string): string; begin Result := EncdDecd.EncodeString(ALogin + ':' + APW); // EncdDecd is not documented in end; procedure TForm4.HTTPRIO1HTTPWebNode1BeforePost(const HTTPReqResp: THTTPReqResp; Data: Pointer); var s: string; begin s := 'Authorization: Basic ' + EncodeLoginPW(UserName, Password); if not

Why is the Compiler warning that variable may not be initialized?

让人想犯罪 __ 提交于 2019-11-28 08:28:46
问题 I am getting a compiler warning I don't understand: procedure Test; var Var1: Integer; begin while True do begin try if System.Random > 0.5 then begin ShowMessage('Skipping'); continue; // If I remove this line, the warning goes away end; Var1:=6; except on E:Exception do begin ShowMessage('Error'); raise; end; end; ShowMessage(IntToStr(Var1)); // Compiler warning on this line end; end; When I compile this in Delphi 2010 I get: [DCC Warning] OnlineClaimManagerMainU.pas(554): W1036 Variable

How to redirect binary gbak output to a Delphi stream?

给你一囗甜甜゛ 提交于 2019-11-28 07:52:25
I want the Firebird backup tool gbak to write its output to a Delphi stream (with no intermediate file). There is a command line parameter to write to stdout rather than a file. I then use the Execute method in JEDI's JclSysUtils to launch gbak and process that output. It looks like this: procedure DoBackup; var LBackupAbortFlag: Boolean; LBackupStream: TStringStream; begin LBackupAbortFlag := False; LBackupStream := TStringStream.Create; try Execute('"C:\path to\gbak.exe" -b -t -v -user SYSDBA -pas "pw" <db> stdout', LBackupStream.WriteString, // Should process stdout (backup) SomeMemo.Lines

Delphi 2010 - hide welcome page

房东的猫 提交于 2019-11-28 07:42:08
Does anybody know how can i disable welcome page without using the < -np > command line option, its very the annoying and blocks the IDE for a few seconds on each start, does anybody know where can i configure this? You can disable it in the registry: under HKEY_CURRENT_USER\Software\CodeGear\BDS\7.0\Known IDE Packages , find the entry named $(BDS)\Bin\startpageide140.bpl and modify the value by prepending an underscore (so it looks like '_Borland Start Page IDE Package' ). You can re-enable it later by removing the underscore. Easier, rename Bin\startpageideXXX.bpl and it won't ever show the

What are the MSBuild project level properties for Delphi?

最后都变了- 提交于 2019-11-28 07:00:35
The Delphi documentation for MSBuild says /property:name=value sets or overrides project-level properties, where name is the property name and value is the property value. Use a semicolon or a comma to separate multiple properties, or specify each property separately. /p is also acceptable. For example: /property:WarningLevel=2;OutputDir=bin\Debug I can't find a list of available properties, here's what I know so far: WarningLevel OutputDir (dcc32 -e equivalent) Config I'd like to get a complete list, but I'm most interested in being able to override the Defines (dcc32 -d equivalent). And if

Practical usage for Delphi's new RTTI - Attributes,Values

戏子无情 提交于 2019-11-28 05:56:46
I found a great explanation about the new RTTI in Delphi ,but I don't understand one important thing about all I have read - Where can I use that? What is it supposed to replace? Runner The extended RTTI works like Reflection in .NET. It gives you access to your internal application structure information. You can access class properties, methods etc.. at runtime, at extent you could not do it before. Some ways of using it: Serialization / Deserialization of classes to XML or other media Mapping of objects to databases. ORM. Cloning of objects Dynamic invocation of methods "Scanning" of object

How use the insert query using parameters?

匆匆过客 提交于 2019-11-28 05:50:48
问题 When i try with this query i get an error says that Perameter email doesn't exist, i am sure that the variables : email, login_pass, payment_method,operateur are valid and exists. SQLQuery2.sql.Text := 'INSERT INTO registered (email,login_pass,payment_method,operateur) VALUES (":email",":login_pass",":payment_method",":avecpuce")'; SQLQuery2.ParamByName('email').AsString := email; SQLQuery2.ParamByName('login_pass').AsString := login_pass; SQLQuery2.ParamByName('payment_method').AsString :=

Is there a Boyer-Moore string search and fast search and replace function and fast string count for Delphi 2010 String (UnicodeString) out there?

这一生的挚爱 提交于 2019-11-28 03:51:52
I need three fast-on-large-strings functions: fast search, fast search and replace, and fast count of substrings in a string. I have run into Boyer-Moore string searches in C++ and Python, but the only Delphi Boyer-Moore algorithm used to implement fast search and replace that I have found is part of the FastStrings by Peter Morris, formerly of DroopyEyes software, and his website and email are no longer working. I have already ported FastStrings forward to work great for AnsiStrings in Delphi 2009/2010, where a byte is equal to one AnsiChar, but making them also work with the String

Add graphical bar to a StringGrid col

故事扮演 提交于 2019-11-28 03:50:01
问题 Using Delphi 2010 and a TStringGrid component, I currently display five filds from a database query. Here is a simplied example of what i am doing //set up the grid procedure TGriddata.FormCreate(Sender: TObject); begin grdMain.Rows[0].commatext:='"One","Two","Three","Four","Five"'; grdMain.ColWidths[0]:= 50; grdMain.ColWidths[1]:= 175; grdMain.ColWidths[2]:= 175; grdMain.ColWidths[3]:= 100; grdMain.ColWidths[4]:= 300; end; //display the data in the grid //note, I am not showing my creation,

Why should I care about RTTI in Delphi?

烈酒焚心 提交于 2019-11-28 03:48:41
I've heard a lot about the new/improved RTTI capabilities of Delphi 2010 , but I must admit my ignorance...I don't understand it. I know every version of Delphi has supported RTTI...and I know that RTTI (Runtime Type Information) allows me to access type information while my application is running. But what exactly does that mean ? Is Delphi 2010's RTTI support the same thing as reflection in .NET ? Could someone please explain why RTTI is useful? Pretend I'm your pointy haired boss and help me understand why RTTI is cool. How might I use it in a real-world application? RTTI in Delphi is still