delphi-2010

How to correctly declare StreamLn [closed]

北城余情 提交于 2019-12-02 23:26:21
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 4 years ago . I am trying to compile my program but I am getting this error: Undeclared indentifier 'StreamLn' i even tried to download PSock.dcu and put it into the library but it doesnt compile, it looks like its compactible with delphi 5, unit ResourceInfo; interface uses Classes, SysUtils, Windows; type

Cannot split word into individual letters in a memo

偶尔善良 提交于 2019-12-02 22:52:26
问题 unit frmDisplaySentence_u; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ComCtrls; type TfrmDispOneChar = class(TForm) edtCode: TEdit; btnDisplay: TButton; lblMsg: TLabel; memOutput: TMemo; procedure btnDisplayClick(Sender: TObject); private { Private declarations } public { Public declarations } end; var frmDispOneChar: TfrmDispOneChar; implementation {$R *.dfm} procedure TfrmDispOneChar.btnDisplayClick(Sender: TObject); var K,

case insensitive Pos

做~自己de王妃 提交于 2019-12-02 20:49:18
Is there any comparable function like Pos that is not case-sensitive in D2010 (unicode)? I know I can use Pos(AnsiUpperCase(FindString), AnsiUpperCase(SourceString)) but that adds a lot of processing time by converting the strings to uppercase every time the function is called. For example, on a 1000000 loop, Pos takes 78ms while converting to uppercase takes 764ms. str1 := 'dfkfkL%&/s"#<.676505'; for i := 0 to 1000000 do PosEx('#<.', str1, 1); // Takes 78ms for i := 0 to 1000000 do PosEx(AnsiUpperCase('#<.'), AnsiUpperCase(str1), 1); // Takes 764ms I know that to improve the performance of

Can I write Windows drivers with Delphi 2010?

两盒软妹~` 提交于 2019-12-02 20:44:03
I've always heard that Delphi can do almost anything C++ can do...except write Windows drivers. Is this correct, and if so, why is that? I recently read a blog post online that may indicate a possible solution for writing drivers with Delphi , but it's 3 years old and I don't know how accurate this information is. So, with the latest version of Delphi (2010), would it be technically possible to write a Windows driver? It may be technically possible to write some drivers with Delphi, but as far as a general answer goes, I'd say: you can't easily write drivers with Delphi . First, there's a

How hard is it to migrate a project from Delphi 7 to Delphi XE?

梦想的初衷 提交于 2019-12-02 17:56:19
Our company have a software that has been in development for over 10 years, so there are some really dated stuff in there. It's still quite functional and everything, but I see the new features on Delphi XE and it makes me want to switch. Problem is that the source code itself is over 300mb of .pas files (1gb total with components, etc). We're using custom components, old jvcl stuff and the latest devexpress. How hard can I expect things to be if I decide to migrate from Delphi 7 to Delphi XE? Thank you. The only real problem is conversion to Unicode. You should learn how Unicode support is

Cannot split word into individual letters in a memo

百般思念 提交于 2019-12-02 13:12:47
unit frmDisplaySentence_u; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ComCtrls; type TfrmDispOneChar = class(TForm) edtCode: TEdit; btnDisplay: TButton; lblMsg: TLabel; memOutput: TMemo; procedure btnDisplayClick(Sender: TObject); private { Private declarations } public { Public declarations } end; var frmDispOneChar: TfrmDispOneChar; implementation {$R *.dfm} procedure TfrmDispOneChar.btnDisplayClick(Sender: TObject); var K, iLength : integer; cOne : char; sCode : string; begin sCode := edtCode.Text; iLength := Length(sCode);

How do I avoid expanding folded regions when I invoke the code formatter?

倾然丶 夕夏残阳落幕 提交于 2019-12-02 06:45:40
问题 As you know, Delphi 2010 has built-in code formatting. However, formatting unfolds all folded code blocks. Any ideas how to fix it? This "feature" is particularly annoying for me and I was really astonished when I couldn't find any mention of this problem. What I've tried: Searching for alternative, e.g., GExperts have code formatter plugin, but it also unfolds code blocks. Tried to write a macro for GExperts: Ctrl+D(format code) -> various code folding/unfolding shortcuts, but couldn't

Collection editor does not open for a TCollection property in a TPersistent property

一曲冷凌霜 提交于 2019-12-02 06:37:36
问题 I've got my custom collection property which is working great when it is a direct member of my component. But I want to move the collection property to a TPersistent propery within my component. And now comes the problem, it doesn't work: double clicking on the collection property in the object inspector normally opens the collection editor, but it does not anymore. Fist of all - what should I pass to the contructor of the TPersistent property? TMyCollection = class(TCollection) constructor

Delphi 2010 object inspector grid and windows dpi

ε祈祈猫儿з 提交于 2019-12-02 06:29:58
I work on high resolution wide screen and I set the dpi to 144 so I can see fonts better. the problem in Delphi 2010 object inspect grid I cant see the text of properties or event names the grid does not scale !! any solution to this ? thank After read your post I asked Uwe Schuster if would be possible to fix this issue with their great "Object Inspector Expert" and he did. You can download it here: http://www.bitcommander.de/blog/index.php/2012/07/15/oi-rev-5/ 来源: https://stackoverflow.com/questions/11443868/delphi-2010-object-inspector-grid-and-windows-dpi

Syntax error with “Rand()” function in MySQL in Delphi

戏子无情 提交于 2019-12-02 04:30:02
I am trying to use the Rand() function within MySQL to select a random record but I am getting a syntax error in the Rand() LIMIT line qryCards.SQL.Add('SELECT * FROM tblCards WHERE Card_Rarity = "Epic"'); qryCards.Open; iCount := qryCards.RecordCount; qryCards.Close; qryCards.SQL.Clear; qryCards.SQL.Add('SELECT * FROM tblCards ORDER BY rand(' + IntToStr(iCount) + ') LIMIT 1'); qryCards.Open; ShowMessage(qryCards.FieldByName('Card_Name').AsString); First off, you are not using RAND() correctly. It returns a decimal number 0 <= N < 1 . The input value is a seed, not an upper limit like you are