delphi-2010

How to Specify Project-Specific Package Settings?

淺唱寂寞╮ 提交于 2019-12-11 00:35:21
问题 How can I specify project-specific package settings in the Delphi 2010 IDE? Changing the packages in the project options does change the packages for all projects in the project group. This is annoying because I build my application with a package that needs to be disabled in order to compile the BPLs in the project group. 回答1: As said in my comment to vcldeveloper's answer (which has somehow vanished now) I can confirm that behaviour. Although I don't know about the intrinsics, I can try to

Addresses of Delphi and C++ WinAPI functions differ when they shouldn't

孤人 提交于 2019-12-11 00:05:02
问题 In C++, if you try to get a function pointer of a Windows API function, that pointer points to the same address you would get if you used GetProcAddress on the name of that function and it's respective module. For example: &MessageBoxA == GetProcAddress("User32.dll", "MessageBoxA"); would be true . However, in Delphi, that is not the case. This code: @MessageBoxA = GetProcAddress('User32.dll', 'MessageBoxA'); Would not be true , and in my test, @MessageBoxA was 0x0040bd18 while the equivalent

Is there a way to make TRadioButton be Transparent?

泄露秘密 提交于 2019-12-10 23:29:01
问题 I'm using delphi 2010 回答1: I agree with Andreas and Serg in that the control is transparent when themes are enabled. I, once, had tried to make the CheckBox transparent for when runtime themes are not enabled in project options, or a classic theme is selected with the OS; the result was not perfect. The below is the same code applied to the RadioButton. Problems easily noticable are, as you would guess from the code, it's a bit flickery and it is not transparent when DoubleBuffered. A problem

Is there a way to install Delphi 2010 on Windows 2000

懵懂的女人 提交于 2019-12-10 20:46:20
问题 I just downloaded the Delphi 2010 iso from my SA-subscription and wanted to install it in addition to my other Delphi installations on my notebook computer. Unfortunately it refuses to install because the machine is running Windows 2000. Is it possible somehow to get it to install it anyway? Or is there a technical reason why it might not work, even if it installed? edit: Some more information: Delphi 2009 installed fine on that computer, so dotNET 2.0 is already installed. The Delphi 2010

Delphi 2010: anyone got the right settings for the formatter not to fold anonymous methods?

孤者浪人 提交于 2019-12-10 19:16:42
问题 With the default settings, the Delphi 2010 code formatter folds anonymous methods on one line. Is there anyone who has found settings to circumvent this? Original code: procedure TUnit.AppendFinalization(const StringBuilder: TStringBuilder); begin AppendMemberResults(StringBuilder, function(Member: TGeneratableInUnit): IStringListWrapper begin Result := Member.FinalizationText; end ); end; procedure TUnit.AppendMemberResults(const StringBuilder: TStringBuilder; const GetMemberText: TFunc

Cross-reference between delphi records

限于喜欢 提交于 2019-12-10 18:55:00
问题 Let's say I have a record TQuaternion and a record TVector. Quaternions have some methods with TVector parameters. On the other hand, TVector supports some operations that have TQuaternion parameters. Knowing that Delphi (Win32) does not allow for forward record declarations , how do I solve this elegantly? Using classes is not really an option here, because I really want to use operator overloading for this rare case where it actually makes good sense. For now I simply moved these particular

Loading dynamic .ini identifiers

こ雲淡風輕ζ 提交于 2019-12-10 18:25:21
问题 I am creating a virtual version of my student planner which basically lets you make notes what homework you have for what subject. Here is the interface: The user selects the subject from the combobox and types in some notes in the adjacent memo. When they are done they will click the 'Save' button which will save it into an .ini file. The selected date will become the section name, the subjects will become the identifier and the text in the memo will become the values for each identifier.

how to color DBGrid special cell?

蹲街弑〆低调 提交于 2019-12-10 16:34:01
问题 I have a column which have only "yes" and "no" values. I want if column value is "yes" then only that cell background color is red else "no" then background color is yellow but this code colors whole row : if ADOTable1.FieldByName('Clubs').AsString = 'yes' then begin DBGrid1.Canvas.Brush.Color := clRed; DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State); end; EDIT Thanks for your replies. My real code look like that. The "netice" column only have "L, D, W,". if Column.FieldName =

Renaming TAction for another form

谁说胖子不能爱 提交于 2019-12-10 16:27:18
问题 I have 2 forms which I'd like to share one single TActionManager and assigned TAction -s. First form is main form - it holds TActionManager , TAction with caption "Action". Main menu of Form1 has this action and menuitem caption property set to "Action A". Form2 includes Form1 and also assigns action to menuitem and caption is set to "Action B". During design time everything looks good - menu items are named "Action A" and "Action B" in Form1 and Form2 and same action is assigned. It also

Invoke MS Access Query which calls a VBA Function in a Module from Delphi ADO Component

南笙酒味 提交于 2019-12-10 15:24:44
问题 I created a function in an MS Access Module, let's say Calculate(A, B) . I also created a Query in MS Access to use this function, let's say: UPDATE aTable SET aField = Calculate(bField, cField) How can I invoke the query, since I tried using: adoConnection.Execute , adoTable , adoQuery , adoCommand , and StoredProcedure , all reject it with the message Undefined function Calculate in expression Thank you in advance. 回答1: You can't. Queries using user-defined VBA functions can only be