This article lists all the fixes included in Update 3 for Delphi 2009.

If you have the initial release of Delphi 2009, you can download updates free of charge from the registered users page.

If you're unsure which release you have, select Help | About in the IDE.

Fix List

QC #: Date Reported: Area:
4790 6/19/2003 Midas\TClientDataSet
Description: Steps:

Midas generates an exception when filtering on WideString fields using "like".

Note from Tomohiro Takahashi
<<<<<<<
QC#10828
>>>>>>>
Open the example project. First press the button 'Load From File', next press 'Filter Widestring' -> Exception

QC #: Date Reported: Area:
6725 12/29/2003 VCL\Printing
Description: Steps:
[QC Short Description]
TPrinter fails in Service Applications on W2K

[QC Description]
When a service application uses the local system account on Windows 2000 the procedure TPrinter.SetToDefaultPrinter fails to identify and set the default printer. The property Printers does contain the complete list of printers. Because the TPrinter object fails to properly set the default printer most calls end up with an exception, even attempting to set the default printer.

In the SetToDefaultPrinter procedure the following block of code is executed and the value of Device is a single space.

else begin
GetProfileString('windows', 'device', '', DefaultPrinter,
SizeOf(DefaultPrinter) - 1);
Cur := DefaultPrinter;
Device := FetchStr(Cur);

{As a w2k service in local account Device is ' ' at this point}

It should also be noted that this is not the method Microsoft recommends for finding the default printer, though I can't seem to find the link on MSDN where I was reading this.
QC Entry 6725
Create new service application. Add Printers to the uses clause In the service attempt to read the value of Printer.PrinterIndex Watch the exception happen via debugger (or with a try/except block and a dialog message (requires the service be set to interact with the desktop)) Note: I had the service set to interact with the desktop, though it still happens when it is not set this way. I did not try running the service in a specific account, only the local system account.
QC #: Date Reported: Area:
7527 3/5/2004 Database\Data Aware Controls\TDBGrid
Description: Steps:
Update: DBGrid doesn't repaint itself correctly when scroll bars get are toggled from off, to on, to off. (This is really seen in master detail apps... when a master record has 0 detail and another master record has serveral detail records)

[QC Short Description]
TDBGrid vertical scrollbar dissappears

[QC Description]
When you have a master/detail record, and the detail is shown using a TDBGrid, then the vertical scrollbar dissappear randomly, even if there are more records than will fit! You can see the right border outline of the scrollbar though, including the thumb thingy moving. It's as if the grid has resized slightly over the scrollbar.

See attached test-case.
QC Entry 7527
1. Compile and Run the attached test-case 2. Record 4 is active in the top grid; note that the bottom detail grid needs a scrollbar to show all records 3. In the top grid activate the record with 5 in the first field 4. Go back to the record 4 exp: Scrollbar in the bottom detail grid should be displayed as in step 2 act: Scollbar is hidden If you repeat steps 3 and 4, notice how the grid scrollbar appears and dissappears. You can just about make out the outline of the scrollbar on the right, including the thumb thingy shadow moving as you scroll!
QC #: Date Reported: Area:
10013 2/14/2008 Database\DBExpress
Description: Steps:
A multithreaded application using the DBX4 Informix driver + the DBXPool delegate will cause a "Connection Name in Use" Informix exception to be thrown.

The customer had previously been using the Luxena DBX driver with a 3rd party connection pool product from RemObjects and the error did not occur with that driver.

TDBXTiburonBugsSuite.Native.DB.Test.exe connection=informixconnection -s:TestRaid_257750
(run multiple times to ensure it doesn't fail)

===original===

I have attached a test case that reproduces the error most of the time.

It spawns multiple threads that open a connection to an Informix database, open a TSQLtable ad iterates through the rows and then closes the database at the end.

Please modify the connection to the database and choose a small table to iterate through. Please modify the column name on line 54 of IFxThreadUnit.pas and choose an alternative varchar column for your table.
QC #: Date Reported: Area:
10318 1/12/2005 IDE\Dialogs\Environment Options
Description: Steps:
[QC Short Description]
Get rid of the horizontal scrollbar in the options dialog

[QC Description]
Get rid of the horizontal scrollbar in the options dialog. It is very unsightly.
QC Entry 10318
+ Click Tools | Options
+ examine treeview

Newsgroup posters are asking that the options dialog be widened to get rid of it by default.
Came back as an issue Highlander / Spacely newsgroups.
QC #: Date Reported: Area:
14010 6/28/2005 IDE\Form Designer
Description: Steps:
[QC Short Description]
Component Captions Disapear after running the application

[QC Description]
The component captions of any component dropped on a TDataModule disapear after runing the program, either if crashes or not.
QC Entry 14010
New steps:
Create a new VCL forms app
Drop a non-visual component (TOpenDialog)
Switch desktop from "Default Layout" to "Classic Undocked"
Note the component captions are gone.

Old steps:
Create a new project
Add a Datamodule
Add DataAccess components (dbGo, dbExpres, ...)
Run the program
Shutdown program and return to Delphi
Open DataModule
Captions disapear
QC #: Date Reported: Area:
14024 6/29/2005 Internet\XML\Data Binding
Description: Steps:
[QC Short Description]
Decimal type, duplicate names 2 errors

[QC Description]
The data binding wizard dosn't recognises the decimal type, it's imported with the default type 'widestring' in my case.

If duplicate names are present in the .xsd file the wizard will create duplicate interface and objects and the compiler will report error. If the interface name is redefined in the wizard dialog the interface definitions will be ok, but the object definitions will be still duplicate.
QC Entry 14024
Generate a binding for the attached file and try to compile it.
QC #: Date Reported: Area:
19963 10/10/2005 IDE\Code Editor\Sync Edit
Description: Steps:
[QC Short Description]
Scrolling in sync edit mode sometimes cancels the sync

[QC Description]
Whan a block of code highlighted, and sync edit is activated scrolling the code editor using the scroll bars (horizontal or vertical) sync edit is cancelled.
But, scrolling using the mouse wheel doesn't cancel sync edit mode.

This is true for C++, and C# projects.
QC Entry 19963
New->Delphi Projects->VCL Forms Application Click on the Code tab CTRL-A to select all CTRL-SHIFT-J to activate sync edit mode Scroll the editor window down by clicking the vertical scroll bar Result; Sync edit is cancelled Now; CTRL-A to select all CTRL-SHIFT-J to activate sync edit mode Scroll the editor window down by rolling the mouse wheel Result; Sync edit is NOT cancelled
QC #: Date Reported: Area:
20997 11/4/2005 VCL\Additional Controls\TSplitter
Description: Steps:
[QC Short Description]
AlignWithMargins blocks TSplitter

[QC Description]

See steps
QC Entry 20997
1) New VCL32 Form 2) Place a TPanel, Align=alTop 3) Place a TSplitter, Align=alTop 4) Place a Panel, Align=alClient 5) Run and test, all Ok 6) Set AlignWithmargins=True on First Panel 7) Run and Test, Splitter is nonfunctional ----- Additional: Setting the Splitter's AlignWithmargins=True also breaks it, setting it for the alClient Panel has no effect
QC #: Date Reported: Area:
22603 1/17/2006 Debugger
Description: Steps:
[QC22603]
Launching a process with Debug Spawned Process enabled, results in an Access violation at address 20A8869D in module 'dbkdebugide100.bpl'. Read of address 00000000. You then have to kill the process in Task Manager. This occurs both with Delphi Win32 and C++ apps.

Here is the stack info:

+ $6[20A8869D]{dbkdebugide100.bpl} Debug.Debug.TProcess.ntfyModulePreLoad (Line 7903, "Debug.pas" + 9) + $6
+ $0[51F06B47]{rtl100.bpl } System.System.@HandleAnyException (Line 9980, "system.pas" + 13) + $0
+ $41[7C903786]{ntdll.dll } RtlConvertUlongToLargeInteger + $41
+ $9[7C90EAF5]{ntdll.dll } KiUserExceptionDispatcher + $9
+ $23C30[15E5DD38]{bordbk100N.dll} @isDbkLoggingOn$qv + $23C30
+ $25397[15E5F49F]{bordbk100N.dll} @isDbkLoggingOn$qv + $25397
+ $B62A[15E45732]{bordbk100N.dll} @isDbkLoggingOn$qv + $B62A
+ $1DDED[15E57EF5]{bordbk100N.dll} @isDbkLoggingOn$qv + $1DDED
+ $1D646[15E5774E]{bordbk100N.dll} @isDbkLoggingOn$qv + $1D646
+ $6A[77D48731]{USER32.dll } GetDC + $6A
+ $14A[77D48811]{USER32.dll } GetDC + $14A
+ $9C[77D4C63A]{USER32.dll } IsWindowUnicode + $9C
+ $16[77D4E900]{USER32.dll } CallWindowProcA + $16
+ $1F[20A8FE09]{dbkdebugide100.bpl} Debug.Debug.TDebugger.DBKWndProc (Line 11172, "Debug.pas" + 3) + $1F
+ $0[51F40BB0]{rtl100.bpl } Classes.Classes.StdWndProc (Line 11572, "classes.pas" + 8) + $0
+ $6A[77D48731]{USER32.dll } GetDC + $6A
+ $14A[77D48811]{USER32.dll } GetDC + $14A
+ $122[77D489C8]{USER32.dll } GetWindowLongW + $122
+ $A[77D496C2]{USER32.dll } DispatchMessageA + $A
I have attached a test case.

Open ProcessLaunch.bdsproj, Enable Debug Spawned Process,

Make this change to the test case to deal with CreateProcessW differences (differences from CreateProcessA, see http://radblog.codegear.net/wiki/index.php?title=Unicode_Enabling_VCL_Applications#CreateProcess) :

procedure TForm1.Button1Click(Sender: TObject);
var
startupInfo : TStartupInfo;
processInfo : TProcessInformation;
ProcName: string;
begin
FillChar(startupInfo, sizeof(startupInfo), 0);
startupInfo.cb := sizeof(startupInfo);
ProcName := 'Project1';
ProcName := ProcName + '.exe';
CreateProcess(Nil, PChar(ProcName), Nil, Nil, True, 0, Nil, Nil, startupInfo, processInfo);
end;

Run the program and click the button.
QC #: Date Reported: Area:
24884 2/14/2006 Internet\XML\Data Binding
Description: Steps:
[QC Short Description]
Duplicate type created for Danish OIOXML Invoice schema

[QC Description]
Denmark is using electronic invoices for all government offices. These are defined in the xml namespace:

http://rep.oio.dk/ubl/xml/schemas/0p71/pie/

The schema in question is:

http://rep.oio.dk/ubl/xml/schemas/0p71/pie/pieStrict.xsd

The two elements "com:TypeCode" and "main:InvoiceCurrencyCode" both use the type TXMLCodeType. This type is generated twice by the wizard.
The resulting code will not compile because of this.

Mind that I haven't read through the schemas to see if they are totally error free. So I won't guarantee that this isn't a problem with the schemas themselves. I don't think so though.
QC Entry 24884
Use the XML data binding wizard to import this xml schema: http://rep.oio.dk/ubl/xml/schemas/0p71/pie/pieStrict.xsd Compile the resulting code.
QC #: Date Reported: Area:
25056 2/17/2006 VCL\Win 32 Controls\TListView
Description: Steps:
[QC Short Description]
When ListView appeares Access Violation message rises.

[QC Description]
In the procedure TCustomListView.CreateWnd there is a piece of code:

if FSaveSelectedIndex <> -1 then
begin
Selected := Items[FSaveSelectedIndex];
Selected.MakeVisible(False);
end;

Sometimes it happendes so that Items[FSaveSelectedIndex] returns NIL value. This causes the trouble described above.
Also method TListItems.GetItem uses the expression ListView_GetItem(Handle, Item), that returns False value. And because of this Items[FSaveSelectedIndex] returns NIL value.
QC Entry 25056
 
QC #: Date Reported: Area:
25613 3/2/2006 IDE\Form Designer
Description: Steps:
[QC Short Description]
sometime component's caption disappear and toolbar dithering when vcl designer show component captions checked

[QC Description]
when IDE use default layout, sometime appear this instance
when use undocked layout, run application will appear this.

very diffault to find different coomponent.
QC Entry 25613
1. Select IDE classic undocked layout 2. In Tools-Options, select VCL Designer, set show component captions checked 3. new a vcl form application, put some non-visual component, such as TClientDataset, TDataSource 4. F9 run the application, then close the application return to IDE then you will find the non-visual component's caption no visual and when you move component, will find the whole IDE repaint(dithering)
QC #: Date Reported: Area:
29792 4/7/2008 IDE\Code Editor
Description: Steps:
[QC Short Description]
Rectangle(Box)-select problem

[QC Description]
If 2-4 byte character(UTF-8 conversion) is done in Rectangle(Box)-select,
the range of the selection becomes unevenly.
QC Entry 60563


[Partial check in
Drawing is OK.

"Column block delete" and "Search/Replace in column block" have to change.
Use file Test1.txt attached
put cursor on the first 2
Alt-Drag over to the 6th 2
Alt-Drag down

//exp: 6 2's to still be chosen
//act: 5 2's are now chosen and there is no way to get 6 2's.






--------------------------------------------

// 1111 2222222222222222
// 1111 aaaa <- 2byte character
// 1111 3333333333333333
// 1111 ???? <- 3byte character
// 1111 4444444444444444
// 1111 ???????? <- 4byte character
// 1111 5555555555555555

file attached containing the correct strings.
using Alt-drag...

1.select from "2" to "a"
2.select from "a" to "3"
3.select from "3" to "?"
4.select from "?" to "4"
5.select from "4" to "??"
6.select from "??" to "5"

Perhaps, it seems that it is because the code editor adopts UTF-8 internally.

If the character in the range of #$80-#$FF is used even if you are in the area
of SBCS, it is likely to reproduce it.

I think that Tiburon becomes a better thing if the problem is solved.
QC #: Date Reported: Area:
30134 6/14/2006 VCL\Win 32 Controls\TListView
Description: Steps:
[QC Short Description]
ListView column width loading and reporting problem

[QC Description]
In Delphi Win32 applications that I am trying to port from Delphi 5 to Delphi 2006 I use ListViews to display data in grids, i.e., ViewStyle is vsReport. I persist grid column order (i.e., index) and width for these ListViews in the registry when the forms are displayed/closed. This functionality worked fine in Delphi 5. However, in Delphi 2006 the ListView behavior has changed such that the column width is not reported correctly. This problem does not appear until the column order is altered.


Also note that when you resize a ListView column in the development environment by dragging the right edge of the column with the mouse, the Width attribute is not updated in the Object Inspector.

(The QC Windows Client wouldn't let me attach any files, so a simplified example is outlined in the "Steps" portion of this report.)
QC Entry 30134
Create a new Delphi "VCL Forms Application". Add a TListView to the form and alter as follows: Name = ListView Align = alTop ViewStyle = vsReport FullDrag = True Checkboxes = True Height = 65 (more or less as desired) Add the following Columns in this order (Caption, Width): <Blank>, 22 (Leave the first column's caption blank.) Column1, 60 Column22, 70 Column333, 80 Column4444, 90 Below the ListView, add a TPanel with property settings: Name = Panel1 Align = alTop Caption = <Blank> Height = 40 Add a TButton to Panel1: Name = ReportButton Caption = Report Add a TMemo below Panel1 and set its properties as follows: Name = Memo Align = alClient Clear all items from Lines. Create an OnClick event for ReportButton and code it as follows: procedure TForm1.ReportButtonClick(Sender: TObject); var Index : Integer; aColumn : TListColumn; begin Memo.Lines.Append('--- Column: Index Caption Width ID ---'); for Index := 0 to ListView.Columns.Count - 1 Do begin aColumn := ListView.Column[Index]; Memo.Lines.Append(Format(' %d %-10s %4d %d', [aColumn.Index, aColumn.Caption, aColumn.Width, aColumn.ID])); end; end; Build and run the program and perform the following steps: Click the Report button. My results follows: --- Column: Index Caption Width ID --- 0 22 0 1 Column1 60 1 2 Column22 70 2 3 Column333 80 3 4 Column4444 90 4 Drag column with caption Column4444 before Column333 and click Report: --- Column: Index Caption Width ID --- 0 22 0 1 Column1 60 1 2 Column22 70 2 3 Column4444 80 4 4 Column333 90 3 The width is being reported incorrectly for the last two columns.
QC #: Date Reported: Area:
32917 8/21/2006 IDE\Repository
Description: Steps:
[QC Short Description]
Shared repository setting prevents additions to repository, and disables Repository menu item

[QC Description]
As per short description, using the Shared Repository setting prevents additions to repository, and disables the Repository menu item.

Also refer to steps. It appears the fix to QC22573 broke this functionality.
QC Entry 32917
1. Start BDS 2. Click Tools menu item. Note that Repository item is enabled 3. Click Tools -> Options and select the Environment Options node 4. Type a valid directory into the Shared Repository text box 5. Click OK 6. Restart BDS 7. Click Tools menu item. Note that Repository item is disabled 8. Start a new project, eg File -> New -> VCL Forms Application 9. Save the project 9. Right-click on the form, and click Add To Repository. 10. Fill in the Title, Description and Author text boxes 11. Click OK 12. Click File -> New -> Other, and make sure the Delphi Files node is selected Exp: Form1 should be available as a repository item Act: Form1 is not available as a repository item
QC #: Date Reported: Area:
35001 10/9/2006 Database\Data Aware Controls\TDBGrid
Description: Steps:
[QC Short Description]
MDIChild's active control focus is not set correctly for a DBGrid.
(Applies to Delphi 7)
[QC Description]
If you have a TWinControl on the MDIForm that can get the focus and then you click on the last active MDI Child, the MDI Child's active control isn't focused for Windows, but the VCL thinks it is and doesn't execute a Windows.SetFocus on it.

The problem is that the SetActiveControl call in TCustomForm.FocusControl doesn't do anything because there was no change in the ActiveControl of the MDIChild. But the "ActiveControl" isn't Focused().
QC Entry 35001
1. Download and start the attached project 2. Click on the button on the left panel 3. Click on a non-selected row of the DBGrid in the MDIChild Expected: The row is now selected Actually: Nothing happens.
QC #: Date Reported: Area:
40110 2/7/2007 VCL\Property/Type Editors
Description: Steps:
[QC Short Description]
Make the openpicture dialog resizeable for the TImageList component editor

[QC Description]
Please make the Openfile dialog for the "Add" function on the ImageList component editor resizeable. The TOpenPictureDialog that is used can be resized nowadays, this should be easy to fix.

Why is this needed?
Its annoying when you have to add images/icons that are larger then 16x16 or use detailed view to see a preview of bitmaps etc.. There will be a lot to scroll and it gets harder to find that file your looking for.
QC Entry 40110
1. Start BDS 2. File / New / Win32 VCL Forms App 3. Add a TImageList to a form 4. double click ImageList to bring up the Component Editor 5. press the "Add" button to add a image/icon to the list. act: The dialog that comes up can not resized. exp: it is resizable
QC #: Date Reported: Area:
42338 3/10/2007 IDE\File Handling
Description: Steps:
When using Ctrl+Enter in the code editor to open a file, the IDE is not able to open an INC file because that extension is not found in the default filetype field in the open file dialog box. You have to manually select the inc file type to have the IDE "see" the inc file. Annoying !

It is expected to have the IDE be able to open anyfile is can find, whatever the extension is. This is specially true for inc files which are frequently used.

// Francois Piette
See also QC42338 which is probably the same issue.

// Francois Piette
Fixed in 2671
1. unzip the attached project, keep the directory structure
2. open the project project1.dpr (or dproj)
3. in project manage, expand the tree to obtain
-TEST1
-TEST2
Unit1.pas

4. Double click on "Unit1.pas"
5. inside the file that you just opened, move the cursor at the begining of "Unit.inc" ... that's inside the include directive
6. Either press <CTRL-ENTER> or right-click and choose Open file at cursor

exp: since the file Unit1.inc resides in the SAME directory with the unit we just opened (Unit1.pas), the file Unit1.INC must be opened at this point
act: the open file dialog pops-up

Why is this wrong? First of all, if you compile the project right after opening it first time, the file in question is found. Second of all, once you open the file at least once, the open file dialog will never be shown again for this file. I suspect that fixing this little glitch will also fix some other "file not found" glitches.
QC #: Date Reported: Area:
46310 5/21/2007 Internet\XML\Data Binding
Description: Steps:
[QC Short Description]
XML Data Binding doesn't create valid source on derived element

[QC Description]
Look at the attached files and Steps.

This problem seems to be apparent only when deriving complex types.
QC Entry 46310
Open the attached Word document with screenshots of the structure of the attached XSD files. 1. Try first the XML Data Binding Wizard with the attached file DelphiXSDText.xsd. The code produced will not compile. 2. The next file, DelphiXSDTest2.xsd, has a dummy element added - and then everything is ok.
QC #: Date Reported: Area:
46313 5/21/2007 Internet\XML\Data Binding
Description: Steps:
[QC Short Description]
XML Data Binding fails when including and deriving

[QC Description]
The wizard will fail to create the source for the base class in the unit, when the element is derived from another included XSD. This is true only if extending the base element.

QC Entry 46313
1. Run the wizard on the attachedfile: DelphiXSDTestDerived.xsd. You will then se that the code for the BaseType complex element, from the file DelphiXSDTestBase.xsd, is not included in the generated unit.
The code will terefore not compile.

Nick Adds:

Actually, when opening the file, I get repeated errors:

---------------------------
Error
---------------------------
The system cannot locate the object specified.

Line: 0

---------------------------
OK Details >>
---------------------------


QC #: Date Reported: Area:
48948 7/12/2007 IDE\Build Tools
Description: Steps:
[QC Short Description]
msbuild shows no errors/warnings/hints of dcc32

[QC Description]
Hello,
there are diffenence between build in IDE and build on comandline.
If I build an program in the IDE, prebuild events are triggert, the project
compiles and post events are triggert.
If dcc32 reports an error/warning/hint, this messages are shown in the IDE.

If you compile a project with msbuild from commandline no
erroes/warnings/hints were printed.

btw: I use the german version (Delphi 2007 for Win32 with Update 1)

Example:
> B:\tools\Borland\BuildServerTest\Source>msbuild
> Microsoft (R)-Buildmodul, Version 2.0.50727.42
> [Microsoft .NET Framework, Version 2.0.50727.42]
> Copyright (C) Microsoft Corporation 2005. Alle Rechte vorbehalten.
>
> Der Buildvorgang wurde um 11.07.2007 11:28:58 gestartet.
> __________________________________________________
> Projekt B:\tools\Borland\BuildServerTest\Source\BuildServerTest.dproj
> (Standardziele):
>
> CoreCompile-Ziel:
> C:\Programme\CodeGear\RAD
> Studio\5.0\bin\dcc32.exe -B -DDEBUG -I;B:\shared\Delphi... --no-config
> BuildServerTest.dpr
>
> Der Buildvorgang war erfolgreich.
> 0 Warnung(en)
> 0 Fehler
>
> Vergangene Zeit 00:00:24.11
>

If no error comes up all is OK !!!

But if there is an error:

> B:\tools\Borland\BuildServerTest\Source>msbuild
> Microsoft (R)-Buildmodul, Version 2.0.50727.42
> [Microsoft .NET Framework, Version 2.0.50727.42]
> Copyright (C) Microsoft Corporation 2005. Alle Rechte vorbehalten.
>
> Der Buildvorgang wurde um 11.07.2007 11:33:25 gestartet.
> __________________________________________________
> Projekt B:\tools\Borland\BuildServerTest\Source\BuildServerTest.dproj
> (Standardziele):
>
> CoreCompile-Ziel:
> C:\Programme\CodeGear\RAD
> Studio\5.0\bin\dcc32.exe -B -DDEBUG -I;B:\shared\Delphi... --no-config
> BuildServerTest.dpr
>
> C:\WINNT\Microsoft.NET\Framework\v2.0.50727\Borland.Delphi.Targets(103,3):
> error MSB6006: "dcc" wurde mit Code 1 beendet.
> Erstellen des CoreCompile-Ziels in Projekt BuildServerTest.dproj beendet -
> Fehler beim Erstellen.
>
> Erstellen des Projekts BuildServerTest.dproj beendet - Fehler beim
> Erstellen.
>
> Fehler beim Buildvorgang.
> C:\WINNT\Microsoft.NET\Framework\v2.0.50727\Borland.Delphi.Targets(103,3):
> error MSB6006: "dcc" wurde mit Code 1 beendet.
> 0 Warnung(en)
> 1 Fehler
>
> Vergangene Zeit 00:00:10.92
>

msbuild gives only the information: (translated to english)
C:\WINNT\Microsoft.NET\Framework\v2.0.50727\Borland.Delphi.Targets(103,3):
error MSB6006: "dcc" ended whith Code 1
Creating of core compile target in project BuildServerTest.dproj ended -
Error on create.

But what is the error?
The IDE prints all information.

If you execute dcc32 direct from comandline (without msbuild) there is the
error message:

> B:\tools\Borland\BuildServerTest\Source>"C:\Programme\CodeGear\RAD
> Studio\5.0\bin\dcc32.exe" -B -DDEBUG -I;B:\shared\Delphi... --no-config
> BuildServerTest.dpr
> CodeGear Delphi f r Win32 Compiler-Version 18.5
> Copyright (c) 1983,2007 CodeGear
> u_main.pas(79) Fehler: E2003 Undefinierter Bezeichner: 'ok'
> u_main.pas(79) Fehler: E2003 Undefinierter Bezeichner: 'doof'
> u_main.pas(79) Warnung: W1023 Vorzeichenbehaftete und -lose Typen werden
> verglichen - beide Operanden werden erweitert
> u_main.pas(83)
> BuildServerTest.dpr(5) Schwerwiegend: F2063 Verwendete Unit 'u_main.pas'
> kann nicht compiliert werden
>

where is the real Error in line 79 of u_main.pas :-)

> // Syntaxfehler beim Compilieren
> ok := (VisualStudio = doof);

Variables "ok", "VisualStudio" and "doof" are not declared.

I used SysInternals ProcessMon to look what Delphi is doing.

The Delphi IDE does not call msbuild.exe / dcc32.exe
The msbuild output in the IDE is created by Delphi IDE.

I hope you can fix it.

msbuild support without errormessages if something goes wrong is useless.

kind regards
Mark Burgard
QC Entry 48948
also see description, because text is too big for Steps :-( 1. Create VCL App (one form with no additional source is ok) 2. Save VCL App. 3. compile in IDE -> OK 4. compile from commandline with msbuild -> OK (1.Example in description) 5. Doubleclick TForm and write some "wrong code" like procedure TForm1.FormCreate(Sender: TObject); begin // this code produce an syntax error while compiling if this is a_syntax_error then do a_compiler(error); end; 6. Save VCL App 7. Compile in IDE -> [DCC Fehler] Unit1.pas(28): E2003 Undefinierter Bezeichner: 'this' [DCC Fehler] Unit1.pas(28): E2015 Operator ist auf diesen Operandentyp nicht anwendbar [DCC Fehler] Project1.dpr(5): F2063 Verwendete Unit 'Unit1.pas' kann nicht compiliert werden 8. compile from commandline with msbuild -> error, but no errormessage msbuild gives only the information: (translated to english) C:\WINNT\Microsoft.NET\Framework\v2.0.50727\Borland.Delphi.Targets(103,3): error MSB6006: "dcc" ended whith Code 1 Creating of core compile target in project BuildServerTest.dproj ended - Error on create. But what is the error? The IDE prints all information. 9. Executeing dcc32 direct from comandline (without msbuild) there is the error message: .... [DCC Fehler] Unit1.pas(28): E2003 Undefinierter Bezeichner: 'this' [DCC Fehler] Unit1.pas(28): E2015 Operator ist auf diesen Operandentyp nicht anwendbar [DCC Fehler] Project1.dpr(5): F2063 Verwendete Unit 'Unit1.pas' kann nicht compiliert werden ....
QC #: Date Reported: Area:
49026 7/13/2007 IDE\Project Management\Project Manager
Description: Steps:
[QC Short Description]
Multiselect in project manager does not work anymore in the german version

[QC Description]
The multiselect feature in the project manager does not work anymore in the german version - IIRC it worked in D2007 RTM. If I remove the german localization files (*.de) then it works as expected.
QC Entry 49026
- start the german IDE - open or create a project which has more then one file in the project manager - try multiselect (it should not work) - close the IDE and start the english version (just remove the *.de files) - open the project again and try multiselect again (it should work now)
QC #: Date Reported: Area:
49054 7/15/2007 IDE\File Handling
Description: Steps:
[QC Short Description]
"List index out of bounds" when closing project previously used in another Delphi "nationality"

[QC Description]
When using a project first in a German, and later in an English Delphi version,

(which up to Delphi 7, as long as the German package still shipped the English version, probably has been quite common, since it would allow to ship local products will local exception texts, and international products with english exception texts)

and adding having added watches (with the IDE set to autosave the desktop) in both IDEs,
the IDE will raise a "List index out of bounds" error on closing the project.
QC Entry 49054


stack trace in comment section.
* Create a simple new project in any Delphi from 7 to 2007, tested especially with Turbo Delphi.
* Set the IDE to autosave desktop changes.
* Close the project.
* Open the ProjectName.dsk file in a text editor.
* Replace the Watches section with the following code to emulate the behaviour from the description:

[Watches]
Count=10
Watch0='slFile[iFile]',256,0,18,1,0,'Watches'
Watch1='bSpecial',256,0,18,1,0,'Watches'
Watch2='countBad',256,0,18,1,0,'Watches'
Watch3='iFile',256,0,18,1,0,'Watches'
Watch4='slFile.Count',256,0,18,1,0,'Watches'
Watch5='Result',256,0,18,1,0,'Watches'
Watch6='cntBad',256,0,18,1,0,'Watches'
Watch7='slSBIs[iSBI]',256,0,18,1,0,'Watches'
Watch8='cs',256,0,18,1,0,' berwachte Ausdr cke'
Watch9='sFilename',256,0,18,1,0,' berwachte Ausdr cke'

* Save and close the editor.
* Open the project in Turbo Delphi.
* Close the project again, say NO to "Save changes", and see the exception raised.

Set Count to 8 and remove the two last entries, or change ' berwachte Ausdr cke' to 'Watches', and it'll be fine again.
QC #: Date Reported: Area:
50307 8/9/2007 VCL\Dialog Controls
Description: Steps:
[QC Short Description]
CenterWindow should use Screen.PrimaryMonitor, not Screen.Monitors[0]
ref: 107066
[QC Description]
The CenterWindow procedure in Dialogs.pas currently uses "Screen.Monitors[0]" to get the primary monitor:

Monitor := Screen.Monitors[0];

While Windows usually enumerates the primary monitor first, this may not always be the case (see comment from Sebastian Zierer).

The line should be corrected to read:

Monitor := Screen.PrimaryMonitor;
QC Entry 50307
N/A
QC #: Date Reported: Area:
50327 8/10/2007 Database\ADO
Description: Steps:
[QC Short Description]
TADODataSet throws "invalid variant operation" exception

[QC Description]
Technical stuff

OS.........: Windows XP SP2 and Windows Vista Business
MDAC.......: 2.81.1117.0
Compiler...: Delphi 2007 for Win32 (11.0.2709.7128)
Database...: MS-SQL Server 2005 Developer and Express with SP2 (9.0.3042)
QC Entry 50327
TDBXWeaverBugsSuite.Native.DB.Test.exe connection=mssqlconnection -s:TestRaid_263745

=or=

Take a look at the example source code (attachment) and you can see everything works fine with an access database/tables.

Try the same thing with MS-SQL 2005 tables where the primary keys are BIGINT and the foreign key ADDR_ID in the second table is also an BIGINT.



Debugging


--> ADODB.PAS

Failure in

procedure TCustomADODataSet.RefreshParams;

in sub function

function MasterFieldsChanged: boolean;
{ .. }
if Parameters.ParamByName(MasterField.FieldName).Value <> MasterField.Value then // <-- This creates the "invalid variant operation"
{ ... }


How to solve?

Seems to be a problem with trying to compare an varDecimal with varInt64?
QC #: Date Reported: Area:
50430 8/13/2007 VCL\Win 32 Controls\TListView
Description: Steps:
[QC Short Description]
TListview loses items if not visible in front

[QC Description]
A TListview loses the items if it is not visible in front.
QC Entry 50430
- Drop a TPagecontrol on a form and add 2 Tabsheets - Drop a TListview on the second Tabsheet, set ViewStyle to vsICON - Create a TImagelist and add some Images; associate the Listview with the Imagelist - Add some items to the Listview - Compile and run - everything works fine, items in the Listivew are there - Make the first Tabsheet the default; save the project again; close all, reopen the project, compile and run - all items in the Lsitview are gone. Sample Project is attached.
QC #: Date Reported: Area:
50972 8/23/2007 VCL\Additional Controls
Description: Steps:
[QC Short Description]
TGridPanel.ControlCollection.AddControl misbehaves if only row OR column are provided

[QC Description]
When you have a TGridPanel on a form (wich has a number of predefined columns and rows that are empty) and try to add a new control
to it (in code) using TGridPanel.ControlCollection.AddControl(NewControl, EitherColumn, OrRow) then the internal PlaceInCell-function in
TGridPanel.ControlCollection.AddControl produces incorrect results (Control is added in the wrong place).

SYSOP:

Add attachment with precompiled executable created from steps given
QC Entry 50972
- create a new form, - place a TGridPanel onto it, name it GridPanel1 - create a number of columns and rows (e.g. 4x4) - leave all cells empty (don't place any controls into the TGridPanel during design time). - create a button, and write the following OnClick-Handler procedure TForm1.Button1Click(Sender: TObject); var mButton: TButton; begin mButton:= TButton.Create(Self); mButton.Align:= alClient; mButton.Caption:= mButton.Name; mButton.Caption:= IntToStr(Button1.Tag); Button1.Tag:= Button1.Tag+ 1; GridPanel1.ControlCollection.AddControl(mButton, 0, -1); mButton.Parent:= GridPanel1; end; - run and press Button1 3 times Expected behaviour: AddControl(mButton, 0) should add all 3 Buttons to Column 0 (as the parameter-names for AddControl(AControl: TControl; AColumn, ARow: Integer) suggest). Since ARow is -1 it should automatically pick the next free row (according to the source-code, since AddControl is exceptionally well documented in the help ;) - so the 3 buttons should be placed in Cell [0, 0], [0, 1] and [0, 2]. Actual behaviour: Button 0 is placed in Cell[0,0], Button 1 and all following Buttons are placed in Cell[0,1]! Reason is a bug in procedure TControlCollection.AddControl(AControl: TControl; AColumn, ARow: Integer); - to be more precise in its subprocedure PlaceInCell(ControlItem: TControlItem); During the test for existing controls in the cells of TGridPanel the Controls- array is accessed with inverted Row/Column indexes - see the test in ExtCtrls.pas line 3382: if Controls[I, AColumn] = nil then... this should actually read if Controls[AColumn, I] = nil then... ! Same applies for if Controls[ARow, I] = nil then.. in Line 3393.
QC #: Date Reported: Area:
51871 9/12/2007 Database\Drivers\InterBase
Description: Steps:
[QC Short Description]
"Invalid transaction object" with Interbase and some DDL statements

[QC Description]
Some DDL commands (alter table...) do not raise error until Commit is issued. But transaction is not completely released, so subsequent Rollback and TSQLConnection.Close/Free fail.
QC Entry 51871
TDBXWeaverBugsSuite.Native.DB.test.exe connection=ibconnection -s:TestRaid_266258

==or==

1: DBXTransaction:=SQLConnection1.BeginTransaction(TDBXIsolations.ReadCommitted);
2: try
3: SQLQuery1.ExecSQL();
4: SQLConnection1.CommitFreeAndNil(DBXTransaction);
5: except
6: SQLConnection1.RollbackFreeAndNil(DBXTransaction);
7: end;
8: SQLConnection1.Close;

SQLConnection1 should be some Interbase connection.
SQLQuery1 should contain:
alter table TABLE1 add
foreign key (FIELD1) references TABLE2 (FIELD2)

TABLE1.FIELD1 should contain values that do not exist in TABLE2.FIELD2, so the alter fails with "violation of FOREIGN KEY constraint "PK..." on table "TABLE2""

Problem is, that this does not raise an exception on line 3 (execsql), but on line 4 (commit). Subsequently rollback (line 6) fails and Close (line 8) also raises an exception.

Interbase only! Other databases/drivers always raise an exception during ExecSQL.
QC #: Date Reported: Area:
52671 9/18/2007 VCL\Standard Controls\TMainMenu
Description: Steps:
Under Vista with Theme, if TMenuItem has DBCS character in caption, and the menu item has a bitmap, Unexpected garbage characters are displayed.

Spacely/Cogswell works fine.

See attached bitmap.

255408-XPCompatible-mode is what I expected.
255408-Vista is actual result.

Some rare case, The application cause AV.

[See. 255411]
 
QC #: Date Reported: Area:
54323 11/2/2007 VCL\Core VCL Classes
Description: Steps:
[QC Short Description]
TStringList.ValueOfIndex fails if string is not in name=value format.

[QC Description]
If an item in a TStringList is not in name=value format, then "ValueFromIndex" returns the string minus the first character.

procedure TForm5.FormShow(Sender: TObject);
var
list :TStringlist;
begin
list := TStringList.Create;
list.Text := 'Bungle';
Caption := list.ValueFromIndex[0]; // Caption = 'ungle';
list.Free;
end;

I'd expect ValueFromIndex to return an empty string (or raise an exception) if the string is not in n=v format. The current behaviour just strange...
QC Entry 54323

// Francois Piette
I still see this in build 2857.9907.4
Create a new Win32.VCL forms application
Drop a TButton on the form and assign code below:

procedure TForm5.FormShow(Sender: TObject);
var
list :TStringlist;
begin
list := TStringList.Create;
list.Text := 'Bungle';
Caption := list.ValueFromIndex[0]; // Caption = 'ungle';
list.Free;
end;

Run the program, click the button. See caption = 'ungle'.
Expected either:
1. Exception raised (because of wrong format of Text)
2. Return an empty string, taking 'Bungle' as the key and no value is associated with the key.
QC #: Date Reported: Area:
55052 11/20/2007 VCL\Win 32 Controls\TDateTimePicker
Description: Steps:
[QC Short Description]
TDateTimePicker.Checked property does not work on Vista

[QC Description]
Under Windows Vista with themes enabled, with the ShowCheckBox property set to True, the Checked property is set to True correctly when the check box is checked, but then remains True when the check box is unchecked.

This is caused by Vista not providing a blank SYSTEMTIME record in the DTN_DATETIMECHANGE notification, but TDateTimePicker requires it to do so. Nowhere in the MSDN documentation for DTN_DATETIMECHANGE does it say that the SYSTEMTIME record will ever be empty in any Windows version. TDateTimePicker should be looking for the GDT_NONE flag instead.
QC Entry 55052
1. File | New | VCL Application
2. drop a TDateTimePicker
3. set DateTimePicker1.ShowCheckbox as True
4. set Checked as False
5. on DateTimePicker.Onclick, add code as:
if DateTimePicker1.Checked then
caption := caption +'checked'
else
caption := caption +'unchecked';
6. Run
7. click the Checkbox in DateTimePicker
//exp: caption show: check, uncheck, check, uncheck
//act : (on VISTA OS)caption show : check....





================OLD STEP =======================
Drop a TDateTimePicker on a TForm
Set the ShowCheckBox property to True
Run the app

The Checked property is initially false.

Click on the check box
The Checked property becomes True

Click on the check box again
The Checked property remains True
QC #: Date Reported: Area:
61608 4/30/2008 VCL\Core VCL Classes\TForm
Description: Steps:
[QC Short Description]
TForm doesn't read Width/ Height if Maximized

[QC Description]
TForm doesn't respect Width and Height values after loading, if WindowState is wsMaximized.
For Vista ClientHeight and ClientWidth are saved in the Form- Resource. In the TCustomForm.ReadState method FClientHeight and FClientWidth are set to inherited Values after reading the complete resource. But in most cases the handle was created and in the method CreateParams TCreateParams.Width/ Height are set to the default values 320/240. The values must set in CreateParams when csLoading in ComponentState.
QC Entry 61608
1. Create new App 2. Set Forms Position to poDesigned, WindowState to wsMaximized. 3.Start the app 4. set the window- state to normal (doubleclick title). The height is 240, the width is 320 like in TCustomForms constructor is set. The design height and width was other values.
QC #: Date Reported: Area:
62539 5/24/2008 VCL\Graphics\TPNGImage
Description: Steps:
[QC Short Description]
The 256 colors of PNG images are broken for run time.

QC Entry 62539


---new description---
8 bit png loses data upon streaming (save to DFM/reload, run app)


TG - Checked in trunk, rev 18406
1.create a new application.
2.drop a TImage onto the form.
3.click the Picture property on Object Inspector.
4.load a 256 colors of png image file.
--Attached, BASI3P08.PNG is from the official PNG test suite.
5.click OK button.
6.run.
//data loss in the image.

this seems to happen when the image data gets streamed out:
7: save the project, reload
//the data on the form in the designer is corrupted.

======================
TG: 11/05/08
The problem is actually in TPngImage.Assign, png.assign(png), the palette data isn't copied to the new image so when it's streamed out, it streams garbage.
QC #: Date Reported: Area:
62754 5/30/2008 IDE\Code Editor\Error Insight
Description: Steps:
[QC Short Description]
Error insight issue with generic arrays

[QC Description]
type
TPair<T,U> = record
key : T;
value : U;
end;
TCollection<T,U> = array of TPair<T,U>;

This compiles but the last line has red squiggles under the 'T' and 'U' in TPair<T,U> with the messages undeclared identifier T, Undeclared identifier U.
QC Entry 62754
Open a Delphi VCL App
add the following code:

type
TPair<T,U> = record
key : T;
value : U;
end;
TCollection<T,U> = array of TPair<T,U>;

QC #: Date Reported: Area:
62992 6/5/2008 Database\DBExpress
Description: Steps:
[QC Short Description]
DBExpress Problems reading/writing Text/Binary Blob Data in Interbase 7 and Blackfish

[QC Description]
Interbase 7 problems:
Reading / Writing Text/Binary Blob Data

BlackfishSQL Problems
Writiing Binary Blobs

Oracle I have not tested?????


example data - working fine for MS-SQL DBExpress driver--->
Read Text Blob
Var
BStream : TStream;
Blobfeld: TField;
St: String;

st := dmodul.quauswahl.FieldByName(zs).asstring; //it seems to make problems with Interbase

alternative this will be OK for MSSQL und MySQL
Blobfeld := dmodul.quauswahl.FieldByName(zs);
BStream:= dmodul.Quauswahl.CreateBlobStream(blobfeld,
bmRead);
try
sz := BStream.Size;
if sz > 0 then
begin
BStream.Read( .
End;
finally
BStream.Free;
end;

Write Text Blob
Var SParM: TParams;
Rtftxt: String;
SParM := TParams.Create(self);

dmodul.quauswahl.Close;
dmodul.quauswahl.SQL.Clear;
dmodul.quauswahl.SQL.Add( Insert Into BlobTab(ID,BLOBFLD)VALUES(1,:par) );
SParM.CreateParam(ftBlob,'par',ptInput);
SParM.ParamByName('par').asstring := rtftxt; // for real text
//or with TMemo Field . SParM.ParamByName('par').Assign( TMemo(TMemoControl).lines);
dmodul.quauswahl.Params := SParM;
dmodul.quauswahl.ExecSQL; //Interbase have problems here
dmodul.quauswahl.Close;

Read Binary Blob
var
Stream: TStream;
query: TSQLquery;
fld: TField;
if not query.FieldByName(zs).isnull then //Interbase results NULL also for non NULL fields
begin
fld := query.FieldByName(zs);
Stream := query.CreateBlobStream(fld, bmRead); //Blackfish MySQL and MSSQL are OK; not Interbase
End;

Write Binary Blob
FStream := TMemoryStream.Create;
FStream.LoadFromFile (binfiledlg.FileName );
dmodul.quleer1.Close;
dmodul.quleer1.SQL.Clear;
dmodul.quleer1.SQL.Add( Insert Into BlobTab(ID,BLOBFLD)VALUES(1,:par) );
dmodul.quleer1.Params[p].DataType := ftBlob;
dmodul.quleer1.Params[p].SetBlobData(FStream.Memory,FStream.Size);
dmodul.quleer1.ExecSQL; //Blackfish and Interbase do not work error in DBXPlatform.pas row 249
dmodul.quleer1.Close;

QC Entry 62992
TDBXTiburonBugsSuite.Native.DB.Test.exe connection=BLACKFISHSQLCONNECTION -s:TestRaid_262742
QC #: Date Reported: Area:
63126 6/10/2008 IDE\Code Editor\Error Insight
Description: Steps:
[QC Short Description]
Generic constrained on "class" can access TObject methods but Error Insight says it cannot

[QC Description]
QC61237 has been fixed and the compiler is happy with the code in the issue.
However, the very same example code gives an error in Error Insight saying GetHashCode is an undeclared identifier.
QC Entry 63126
1. Get build 3079 and type the code at the bottom in a unit 2. Compile Exp: Compilation succeeds Act: Compilation succeeds 3. Observe Error Insight Exp: No error indicated Act: 4 errors: GetHahCode is not declared ========================================================================================================= interface type IEquatable<T> = interface function Equals(Other: T): Boolean; end; IEqualityComparer<T> = interface function Equals(A, B: T): Boolean; function GetHashCode(Obj: T): Integer; end; TEquatable<T: class> = class(TInterfacedObject, IEquatable<T>, IEqualityComparer<T>) public { IEquatable<T> } function Equals(Other: T): Boolean; overload; { IEqualityComparer<T> } function Equals(A, B: T): Boolean; overload; function GetHashCode2(Obj: T): Integer; function IEqualityComparer<T>.GetHashCode = GetHashCode2; end; implementation //=== { TEquatable<T> } =========================================== function TEquatable<T>.Equals(Other: T): Boolean; begin if Other = nil then Result := False else Result := GetHashCode = Other.GetHashCode; end; function TEquatable<T>.Equals(A, B: T): Boolean; begin if A = nil then Result := B = nil else if B = nil then Result := False else Result := A.GetHashCode = B.GetHashCode; end; function TEquatable<T>.GetHashCode2(Obj: T): Integer; begin if Obj = nil then Result := 0 else Result := Obj.GetHashCode; end;
QC #: Date Reported: Area:
63188 6/11/2008 IDE\Project Management\Project Manager
Description: Steps:
[QC Short Description]
Project options: search path -> MSBuild "-I" and "-U" are correct, but "-O" and "-R" are not

[QC Description]
While using the source version of the JVCL I noticed that the IDE does not add the search path to the -O and -R option in the MSBuild command line. In fact of the incorrect -R option the resource files could not
be found and I had to add the resource file path to the library path to get it compiling.

Delphi 2007:

-I<Project search path>;<library path>
-O<Project search path>;<library path>
-R<Project search path>;<library path>
-U<Project search path>;<library path>

Tiburon:

-I<Project search path>;<library path>
-O<library path>
-R<library path>
-U<Project search path>;<library path>
QC Entry 63188
- start Tiburon - create a new Delphi.Win32 project - enter "c:\MySearchPath" into "Search path" on the page for the node "Delphi Compiler" in the project options - enter "c:\MyNewResourcePath" into "Include file search path" on the page for the node "Resource Compiler"\"Directories and Conditionals" (this is just to check if this path ends up somehow in -R option -> it doesn't and I don't expect that) - compile - switch to the "Output" tab in the message pane - copy the "dcc32.exe" line and paste it into notepad.exe (or any other tool where you can better read and re-format it) expected: -Ic:\MySearchPath;<library path> -Oc:\MySearchPath;<library path> -Rc:\MySearchPath;<library path> -Uc:\MySearchPath;<library path> actual: -Ic:\MySearchPath;<library path> -O<library path> -R<library path> -Uc:\MySearchPath;<library path>
QC #: Date Reported: Area:
63347 6/16/2008 IDE\Open Tools API
Description: Steps:
[QC Short Description]
TOTAEditPos and TOTACharPos do not take multi-byte characters into account

[QC Description]
For example, let's take this code:

ShowMessage('S'); // S is any multi-byte character in the UTF-8 encoding

If the cursor is immediately before the S, IOTAEditView.CursorPos.Col is 14, as expected. After using IOTAEditView.ConvertPos to convert it to a TOTACharPos, the CharIndex is 13, as expected.

Now, if the cursor is moved one character to the right, so it's immediately AFTER the S, CursorPos.Col is 16, and converted to a TOTACharPos the CharIndex is 15.

This doesn't seem right. I would expect moving the cursor one character to the right to increment CursorPos.Col by 1, not 2.

This might be related to QC 29792.

Note: This issue also exists in Delphi 2007. The editor status bar shows the proper value for the column in the above case. If this is as- designed (even though that would make the member names like Col misleading, and CharPos is really a BytePos), please document the behavior of these two records inside ToolsAPI.pas.
QC Entry 63347
(From comments in the code)

1. Compile and install this package. A window will appear that shows the reported cursor location, both as an OTAEditPos and an OTACharPos.

2. Place the cursor before the ? character (QC does not support unciode, the character is Cyrillic $D096) on the line below in the included .pas file:

ShowMessage(' ? ');

3. Wait a second for the list to update. Note the column value of the EditPos and CharPos (19/18)

4. Now press the right arrow key, moving the cursor to the right of the ?. Wait a second for the list to update, and again note the EditPos and CharPos.

Result: The EditPos and CharPos will have increased by 2, even though the cursor only moved one character, or one column. The reported column is incorrect.

You should be able to insert any character that is multi-byte in the UTF-8 encoding into the source code and see the same behavior.
QC #: Date Reported: Area:
64484 7/15/2008 RTL\Delphi\RTL Exceptions
Description: Steps:
[QC Short Description]
SysUtils.Abort can raise an AccessViolation

[QC Description]
The SysUtils.Abort procedure can raise an AccessViolation if compiler uses the EBP register in the caller for a variable. Furthermore the Abort::ReturnAddress function doesn't return the return address of Abort but the return address of the caller. This is because SysUtils.Abort doesn't have a stack frame.
QC Entry 64484
1. Create a new VCL application 2. Put the following code into the OnCreate event handler 3. Execute the application procedure TForm1.FormCreate(Sender: TObject); begin {1} asm push ebp; mov ebp, 1; end; // this could be done by the optimizer {2} Abort; {3} asm pop ebp; end; end; Expected: Abort raises an EAbort exception at address {2} Actual: Abort crashes with an access violation because [EBP+4] fails.
QC #: Date Reported: Area:
64644 7/20/2008 Debugger\Call Stack
Description: Steps:
[QC Short Description]
The call stack is not updating properly when switching threads.

[QC Description]
The call stack is not updating properly when switching threads.
QC Entry 64644


This is a problem when the number of call stack items in the new thread is the same as the number of items in the old thread.
When the execution is paused on a multithreaded application, when switching threads from the "Threads" window, the callstack is not always updating properly to reflect the active thread. In about 50% of the cases it will still show the callstack of the thread that was selected previously. 1. Start a multithreaded application. 2. Pause the execution. 3. Open the Thread window. 4. Double click on a thread different than the currently active one. 5. Observe the Call Stack view. When repeating steps 4 and 5 you will notice that often the callstack is not updated when the thread is switched.
QC #: Date Reported: Area:
64819 7/24/2008 VCL
Description: Steps:
[QC Short Description]
Delphi JPEG Output Stops Working After 24 Days

[QC Description]
The jpeg.pas file contains a bug which causes JPEG output to stop working or potentially cause a Range Check Error after the workstation has been booted for High(Integer) milliseconds (about 24 days). The problem is that Delphi assigns the LongWord returned from GetTickCount() to an Integer, instead of to another LongWord.

The following lines need to be altered in the jpeg.pas file... Search for the words "Added" and "Removed" to see what needs to be changed in order to fix the bug.

jpeg_progress_mgr = record
progress_monitor : procedure(const cinfo : jpeg_common_struct);
pass_counter : Integer; { work units completed in this pass }
pass_limit : Integer; { total number of work units in this pass }
completed_passes : Integer;
{ passes completed so far }
total_passes : Integer; { total number of passes expected }
// extra Delphi info
instance: TJPEGImage; // ptr to current TJPEGImage object
last_pass: Integer;
// last_pct: Integer; // Removed - 7/24/2008
// last_time: Integer; // Removed - 7/24/2008
last_pct: LongWord; // Added - 7/24/2008
last_time: LongWord; // Added - 7/24/2008
last_scanline: Integer;
end;

...

procedure ProgressCallback(const cinfo: jpeg_common_struct);
var
// Ticks: Integer; // 7/24/2008 - Removed
Ticks: LongWord; // 7/24/2008 - Added
R: TRect;
// temp: Integer; // 7/24/2008 - Removed
temp: LongWord; // 7/24/2008 - Added
begin

...
QC Entry 64819
 
QC #: Date Reported: Area:
64978 7/29/2008 RTL\Delphi
Description: Steps:
[QC Short Description]
Overloaded AnsiLeftStr/AnsiMidStr/AnsiReverseString/AnsiRightStr unicode-functions doesn't exist.

[QC Description]
Overloaded AnsiLeftStr/AnsiMidStr/AnsiReverseString/AnsiRightStr unicode-functions doesn't exist.

When the function for AnsiString is used instead, the Unicode character that doesn't exist in MBCS is not correctly processed.

- LeftStr
- MidStr
- ReverseString
- RightStr

When these functions are used instead, a surrogate pair is not correctly processed.
QC Entry 64978
 
QC #: Date Reported: Area:
65155 8/2/2008 RTL\Delphi
Description: Steps:
[QC Short Description]
AnsiLeftStr/AnsiRightStr/AnsiMidStr does round-trip conversion.

[QC Description]
AnsiLeftStr/AnsiRightStr/AnsiMidStr does round-trip conversion.
QC Entry 65155
procedure TForm1.Button1Click(Sender: TObject);
type
SJISString = type AnsiString(932);
var
A: SJISString;
U, S: String;
i: Integer;
begin
A := StringOfChar(#$20, 6);
A[1] := #$81; // Multi-byte Character (#$81#$E6)
A[2] := #$E6;

A[3] := #$87; // Multi-byte Character (#$87#$9A)
A[4] := #$9A;

A[5] := #$FA; // Multi-byte Character (#$FA#$5B)
A[6] := #$5B;

A := A + 'ABC';
A := AnsiLeftStr(A, 3); // <- First 3 characters

S := '';
for i:=1 to Length(A) do
S := S + Format('#$%.2x',[Ord(A[i])]);
ShowMessage(Format('%s : %s',[A, S]));
end;


// EXP: #$81#$E6 #$87#$9A #$FA#$5B
// ACT: #$81#$E6 #$81#$E6 #$81#$E6

QC #: Date Reported: Area:
65226 8/4/2008 RTL\Delphi\Pascal Strings
Description: Steps:
[QC Short Description]
_LStrFromPWCharLen writes 0 into codePage field

[QC Description]
When a UnicodeString is assigned to an AnsiString, _LStrFromPWCharLen writes 0 in the AnsiString's code page field.
This is inconsistent with _NewAnsiString, which initializes the code page field to DefaultSystemCodePage. (0 is translated to DefaultSystemCodePage internally.)

As a consequence of this bug, string conversions do not round-trip correctly when a custom DefaultSystemCodePage setting is used. (See Test #2)

Suggested fix:

procedure _LStrFromPWCharLen(var Dest: AnsiString; Source: PWideChar; Length: Integer; CodePage: Word);
var
DestLen: Integer;
begin
if Length <= 0 then
begin
_LStrClr(Dest);
Exit;
end;

// ADD THESE TWO LINES:
if CodePage = 0 then
CodePage := DefaultSystemCodePage;
DestLen := CharFromWChar(nil, 0, Source, Length, CodePage);
SetLength(Dest, DestLen);
if DestLen > 0 then
begin
CharFromWChar(Pointer(Dest), DestLen, Source, Length, CodePage);
PStrRec(Integer(Pointer(Dest)) - skew).codePage := CodePage;
end
else
_LStrClr(Dest);
end;
QC Entry 65226
Test #1: {$ASSERTIONS ON} var U: UnicodeString; A: AnsiString; begin // _NewAnsiString test -- this correctly sets codePage=DefaultSystemCodePage SetLength(A, 1); // These succeed: Assert(StringCodePage(A) <> 0); Assert(StringCodePage(A) = DefaultSystemCodePage); // _LStrFromPWCharLen test -- this incorrectly sets codePage=0 U := 'test'; A := U; // These fail: Assert(StringCodePage(A) <> 0); Assert(StringCodePage(A) = DefaultSystemCodePage); end. Actual result: The second set of assertions fail. Expected result: No assertion failures. ========================================= Test #2: {$ASSERTIONS ON} var A: AnsiString; U: UnicodeString; begin Assert(DefaultSystemCodePage = 1252); DefaultSystemCodePage := 1251; // Cyrillic // Initialize the AnsiString SetLength(A, 1); A[1] := #212; // Convert ANSI -> Unicode U := A; Assert(U = #$0424); // Convert Unicode -> ANSI A := U; Assert(A[1] = #212); // Convert ANSI -> Unicode again U := A; Assert(U = #$0424); // Assertion fails! end. Actual result: The last assertion fails. Expected result: No assertion failures.
QC #: Date Reported: Area:
65691 8/14/2008 VCL\Win 32 Controls
Description: Steps:
[QC Short Description]
Remove ExtActns from ComCtrls uses clause to save 7 KB

[QC Description]
ComCtrls includes "ExtActns" in its "uses" clause, but does not actually make use of it.

By removing it, up to 7 KB can be saved.
QC Entry 65691
1. Create new VCL app, note EXE size: 491 KB 2. Remove ExtActns from ComCtrls' "uses" clause, and rebuild it. 3. Create new VCL app, note EXE size: 484 KB
QC #: Date Reported: Area:
65741 8/17/2008 Compiler\Delphi\Code Generation/Optimization
Description: Steps:
[QC Short Description]
Inlining broken in recent FT builds

[QC Description]
Code inlining stopped working consistently in FT build 3137, and remains broken in 3149.
QC Entry 65741

[BJK: Note: fix is already in svn but disabled until post-ship. Merge command should enable the fix:

svn merge -r 16722:16723 decl.c]
program Project1; {$APPTYPE CONSOLE} {$INLINE ON} uses Windows; procedure Test; inline; begin MessageBeep(0); end; begin Test; end. Actual result: Project1.dpr.14: Test; 004040DC E88FFBFFFF call Test Expected result (from Delphi 2007): Project1.dpr.14: Test; 004040C4 6A00 push $00 004040C6 E829F9FFFF call MessageBeep
QC #: Date Reported: Area:
65877 8/20/2008 VCL\Multi-Monitor Support
Description: Steps:
[QC Short Description]
FileCtrl SelectDirectory appears on wrong monitor

[QC Description]
function TSelectDirCallback.SelectDirCB() tries to position the SelectDirectory dialog on a suitable monitor, but this goes wrong if it's not the primary monitor. It can be fixed by adding Monitor.Left and Monitor.Top like this:


SetWindowPos(Wnd, 0, Monitor.Left{<--added} + (Monitor.Width - (Rect.Right - Rect.Left)) div 2,
Monitor.Top{<--added} + (Monitor.Height - (Rect.Bottom - Rect.Top)) div 2, 0, 0, SWP_NOSIZE or SWP_NOZORDER);

QC Entry 65877
Call selectdirectory from an app which is not on the primary monitor
QC #: Date Reported: Area:
65912 8/20/2008 IDE\Search\Find in Files
Description: Steps:
[QC Short Description]
When 4bytes-character is included in source-code, result of file-search isn't correctly displayed.

[QC Description]
When 4bytes-character is included in source-code, result of file-search isn't correctly displayed.
QC Entry 65912
1. Open Attachment. 2.[Search | Find] 3.[Find in Files] 4.Input 4 byte character to "Text to find:". 5.The display of the result collapses. EXP: UTF_8.txt(6): // 1111 BNNN UTF_8.txt(6): // 1111 NBNN UTF_8.txt(6): // 1111 NNBN UTF_8.txt(6): // 1111 NNNB ACT: UTF_8.txt(6): // 1111 BNNN UTF_8.txt(6): // 1111 XXXXNN UTF_8.txt(6): // 1111 NBNN UTF_8.txt(6): // 1111 NXXXXN B: Hit 4bytes-character. (Displayed by bold) N: 4bytes-character. X: Broken character. Please See find_result.gif
QC #: Date Reported: Area:
66173 8/28/2008 IDE\Refactoring\Rename
Description: Steps:
[QC Short Description]
Refactorings don't work for overloaded procedures/functions.

[QC Description]
Refactorings don't work for overloaded procedures/functions.
If you try to rename variables, it works for the last overload declared in the file.
QC Entry 66173

[occurs in Rad Studio 2007, however in Tiburon the results are worse]
------------------------------------------------------------ unit Unit1; interface procedure TestProc; overload; procedure TestProc(I: Integer); overload; procedure TestProc(S: String); overload; implementation // 1st procedure TestProc; var Dmy: String; begin Dmy := Dmy + 'A'; end; // 2nd procedure TestProc(I: Integer); var Dmy: String; begin Dmy := Dmy + 'A'; end; // 3rd procedure TestProc(S: String); var Dmy: String; begin Dmy := Dmy + 'A'; end; end. ------------------------------------------------------------ 1.Move to first declared variables "Dmy". 2.[Refactor | Rename] 3.Input "NewName". EXP: Variable that exists in the first declaration is renamed. ACT: Variable that exists in the last declaration is renamed.
QC #: Date Reported: Area:
66230 8/29/2008 VCL\Registry / INI Objects
Description: Steps:
[QC Short Description]
UTF-8 bug in TMemIniFile.LoadValues

[QC Description]
When loading an ini file, TMemIniFile.LoadValues() retreives the BOM from the front of the file and then calls TEncoding.GetBufferEncoding() to figure out which encoding the BOM is describing. However, LoadValues() only reads 2 bytes, but the
UTF-8 BOM is 3 bytes instead. GetBufferEncoding() requires the full BOM, so TMemIniFile will never be able to load UTF-8 ini files correctly.

If QC #64550 ("Encoding property in TStrings") were implemented, then TMemIniFiles.LoadValues() would not have to detect the Encoding manually at all anymore. TStrings could do it, and then TMemIniFile could remember the Encoding that
was used.
QC Entry 66230

SB: Fix attached
 
QC #: Date Reported: Area:
66318 9/2/2008 Database\Core VCL\Lookup
Description: Steps:
[QC Short Description]
DBExpress and ClientDataSet can't locate record with Chinese

QC Entry 66318
TDBXBugsTiburonBugsSuite.Native.DB.Test.exe connection=mssqlconnection -s:TestRaid_265035

-----

1. add sqlconnection, sqltabel, datasetprovider, clientdataset, datasource, and dbgrid into form.
2. connect them to an interbase db.
3. add edit and button to the form.
4. write code:
procedure TForm1.Button1Click(Sender: TObject);
begin
if ClientDataSet1.Locate('CHARFIELD', edit1.text, []) then
showmessage('Found');
end;

then run it.

I used a table with an unicode column.
I can see the date by DBGrid, and I can edit or insert it.
But, ClientDataSet just can locate English string. can't work with Greek, Hebrew, and Chinese.
I copy the string from DBGrid to Edit directly, but it can't work too.
QC #: Date Reported: Area:
66346 9/2/2008 Install
Description: Steps:
On ESD Install, DB Pack is not installing, and the installer is indicating the install completed successfully.

This results in missing DB files from the IDE and an error on start up of 'Unable to load DBExpress120.bpl'

QC Entry 66346
Began with a scrubbed-clean VirtualBox VM. With no directory structure nor Registry entries for Borland, CodeGear or Embarcadero.

Install RAD Studio via ESD, Delphi Win32 environment only.

Note: original steps for Quentin were Delphi install only, no dbGo/ADO or Rave.

All went OK until trying to open RAD Studio. Three package loading errors occur during loading. A Zip file of error msg images attached. The Zip file also contains a txt file of the system PATH.
QC #: Date Reported: Area:
66368 9/3/2008 Compiler\Delphi\Anonymous Methods
Description: Steps:
[QC Short Description]
Internal error when trying to capture Result

[QC Description]
The compiler seems to generate a sensible error when you attempt to capture Result, but only if Result is a managed type. For non-managed types, it generates an internal error:

[DCC Fatal Error] F2084 Internal Error: T2675
QC Entry 66368
Compile the attached application below

See the following internal error.

Fatal: F2084 Internal Error: T2675

program BTS265026;

{$APPTYPE CONSOLE}

uses
SysUtils;

var
Counter: Integer = 0;

type
TProcX = reference to procedure;

procedure foo(x: TProcX);
begin
x();
end;

function Z: Integer;
begin
Foo(
procedure
begin
Result := 1234;
WriteLn(Format('%d', [Result]));
end);
end;

procedure DoIt;
begin
Z;
WriteLn('PASS');
end;

begin
try
DoIt;
except
on E: Exception do
WriteLN('FAIL Exception=', E.ClassName, '/', E.Message);
end;
end.
QC #: Date Reported: Area:
66403 9/4/2008 IDE\Class Completion
Description: Steps:
[QC Short Description]
Class Completion fails if a variant record is in the unit interface

[QC Description]
If you invoke class completion in a unit that has a record with a variant part, it will display false error in the record. Comment out/remove the variant record and it works as expected.

QC Entry 66403
1. Load up the simple project in this attachment 2. In the PyroScripting unit, put cursor on one of the classes and try to do class completion 3. You will see the error I'm talking about 4. Comment out the TPyroScriptStackInfo record and go to #2, it will then work.
QC #: Date Reported: Area:
66432 9/5/2008 IDE\Object Inspector
Description: Steps:
[QC Short Description]
Some object inspector dropdows extend beyond the screen edges.

[QC Description]
The maximum number of items in a dropdown in the OI was recently increased from 8 to 20. Unfortunately this causes some custom-drawn property lists with large items to extend beyond the edges of the screen. Example: TControl.Cursor.

I recommend the maximum number of items in an OI dropdown to be reduced from 20 to 16.
QC Entry 66432
1) File -> New -> VCL Forms Application (Delphi for Win32) 2) Select the form 3) Select the Cursor property in the OI 4) Click the dropdown for the Cursor property Notice how the dropdown list extends beyond the top or bottom of the screen.
QC #: Date Reported: Area:
66473 9/6/2008 IDE\File Handling
Description: Steps:
[QC Short Description]
Search path to add unit: not work

QC Entry 66473
In build 3155, I try this: File, New, Package Then, in ProjectGroup1, Package1, right click, Add, and I see the dialog Add, Add Unit. I Browse to my directory of units, and insert my file. Then, if I want add another unit: ProjectGroup1, Package1, right click, Add, and I see the dialog Add, Add Unit. I see in Search path my previous directory, but, if I click on Browse, I start from ".....\RAD Studio\Projects". Expected: Browse in the path indicated. I not remember if this bug is present in previous build or version. If not, it can be a "nice to have". Request of QC from: medington@codegear.com
QC #: Date Reported: Area:
66652 5/3/2008 IDE\Code Editor\Help Insight
Description: Steps:
[QC Short Description]
Help Insight displays the wrong data types.

[QC Description]
Help Insight doesn't seem updated with the new data types for PChar, widestring, UTF8String and UCS4String. The steps has a function with a list of examples with the type displayed in comments. The correct code is run and code completion displays the correct stuff, only help insight is wrong.

I didn't include all as every single function with these data types displays the wrong info. Note that most of them do not show the wrong data type in system.pas, only outside it.

QC Entry 61688
1) Create a new application. 2) Paste the following function in the implementation section: function Test: PChar; // <-- PAnsiChar var dest: PChar; // <-- PAnsiChar begin //function Utf8Encode(const WS: WideString): UTF8String; UTF8Encode(''); // <-- return type System.String //function UCS4StringToWideString(const S: UCS4String): WideString; UCS4StringToWideString(''); // <-- Parameter type System.$$8, return type System.String //function WideStringToUCS4String(const S: WideString): UCS4String; WideStringToUCS4String(''); // <-- Parameter type System.$$8, return type System.String //function UnicodeStringToUCS4String(const S: UnicodeString): UCS4String; UnicodeStringToUCS4String(''); // Parameter type Void Type, return type System.$$9, in the system unit the parameter type is still wrong and it says it overrides itself (System.UnicodeStringToUCS4String), may be because of magic though ;) //function PUCS4Chars(const S: UCS4String): PUCS4Char; PUCS4Chars(''); // Parameter type System.$$10 //function Utf8ToAnsi(const S: UTF8String): string; Utf8ToAnsi(''); // Parameter type System.String, no return type shown, and should this function really return a unicode string? the code inside it seems to be lacking //function AnsiToUtf8(const S: string): UTF8String; AnsiToUtf8(''); // Parameter type Void Type, return type System.String end;
QC #: Date Reported: Area:
66685 9/15/2008 11:23:14 AM SOAP
Description: Steps:
[QC Short Description]
Missing multiplication with SizeOf(Char)

[QC Description]
I found occurences of this sort of construct :

TStream.Write(UnicodeString[1], Length(UnicodeString));

As far as I understand, this misses the SizeOf(WideChar) multiplication.


After I hit the first occurance, I searched the whole sources folder for the
substring "[1], Length(", and look what I found :

D:\Temp\CodeGear_RAD Studio_6.0_source_3168.2\Win32\soap\InvokeRegistry.pas
2400 FSourceStream.Write(Value[1], Length(Value));

D:\Temp\CodeGear_RAD Studio_6.0_source_3168.2\Win32\soap\OPToSOAPDomConv.pas
634 Stream.Write(Request[1], Length(Request) * 2);
1546 Stream.Write(Resp[1], Length(Resp));

D:\Temp\CodeGear_RAD Studio_6.0_source_3168.2\Win32\soap\SOAPAttach.pas
422 AStream.Write(AValue[1], Length(AValue));
613 ADestStream.Write(SLine[1], Length(SLine));
829 Stream.Write(Attachment.SourceString[1],
Length(Attachment.SourceString));
QC Entry 66685
Search the whole sources folder for the substring "[1], Length("

Any occurance that uses arrays containing anything wider than a byte (like UnicodeString) should be fixed,
by adding a multiplication with SizeOf(elementtype).

QC #: Date Reported: Area:
66685 9/15/2008 11:10:30 AM Database\Data Aware Controls
Description: Steps:
[QC Short Description]
Missing multiplications with SizeOf(Char)

[QC Description]
I found an occurence of this sort of construct :

TStream.Write(UnicodeString[1], Length(UnicodeString));

As far as I understand, this misses the SizeOf(WideChar) multiplication.


After I hit the first occurance, I searched the whole sources folder for the
substring "[1], Length(", and look what I found :


D:\Temp\CodeGear_RAD Studio_6.0_source_3168.2\Win32\db\DBCtrls.pas
2019 if PasswordChar <> #0 then FillChar(S[1], Length(S), PasswordChar);

Search the whole sources folder for the substring "[1], Length("

Any occurance that uses arrays containing anything wider than a byte (like UnicodeString) should be fixed,
by adding a multiplication with SizeOf(elementtype).

QC #: Date Reported: Area:
66685 9/15/2008 11:14:28 AM AddOn\Interbase components
Description: Steps:
[QC Short Description]
Missing multiplication with SizeOf(Char)

[QC Description]
I found an occurence of this sort of construct :

TStream.Write(UnicodeString[1], Length(UnicodeString));

As far as I understand, this misses the SizeOf(WideChar) multiplication.


After I hit the first occurance, I searched the whole sources folder for the
substring "[1], Length(", and look what I found :

D:\Temp\CodeGear_RAD Studio_6.0_source_3168.2\Win32\IBX\IBSQL.pas
2081 FFile.Write(st[1], Length(st));
2102 BytesWritten := FFile.Write(st[1], Length(st));

Search the whole sources folder for the substring "[1], Length("

Any occurance that uses arrays containing anything wider than a byte (like UnicodeString) should be fixed,
by adding a multiplication with SizeOf(elementtype).

QC #: Date Reported: Area:
66738 9/13/2008 RTL\Delphi\RTL Exceptions
Description: Steps:
[QC Short Description]
TDictionary - AddOrSetValue bug

[QC Description]
When I want to use this code:

with TDictionary<string,string>.Create do
try
AddOrSetValue('AKey', 'AValue');
finally
Free;
end;

Delphi throws an exception:

Access violation at address 004B8FFC in module 'Demo.exe'. Write of address FFFFFFF4.
QC Entry 66738
Compile and run the attached application below.

See the following program output indicating failure.

FAIL Exception=EAccessViolation/Access violation at address 00414C78 in module '
QC66738.exe'. Write of address FFFFFFF4


Notice that if the statement that reads
D := TMyD.Create;
is edited to read as follows,
D := TMyD.Create(1);
then the application compiles and runs as expected.


program QC66738;

{$APPTYPE CONSOLE}

uses
SysUtils,
Generics.Collections;

type
TMyD = TDictionary<String, String>;

var
D: TMyD;
begin
D := TMyD.Create;
try
with D do
try
D.AddOrSetValue('AKey', 'AValue');
finally
D.Free;
end;
WriteLN('PASS');
except
on E: Exception do
WriteLn('FAIL Exception=', E.ClassName, '/', E.Message);
end;
end.
QC #: Date Reported: Area:
66761 9/14/2008 RTL\Delphi\Memory, Pointer, Address
Description: Steps:
Use of TDictionary types can introduce a memory leak into a program. program Dictionary; {$APPTYPE CONSOLE} uses SysUtils, Generics.Collections; var Key : string; ADictionary: TDictionary<string, string>; begin ReportMemoryLeaksOnShutdown := True; try // Bug 1: AddOrSetValue throws an exception when I write this: // ADictionary := TDictionary<string, string>.Create; ADictionary := TDictionary<string, string>.Create(1); try ADictionary.AddOrSetValue('Key_1', 'Value_1'); ADictionary.AddOrSetValue('Key_2', 'Value_3'); ADictionary.AddOrSetValue('Key_1', 'Value_4'); ADictionary.AddOrSetValue('Key_2', 'Value_5'); // Bug 2: memory leak => for Key in ADictionary.Keys do WriteLn(Key); // the solution: // ADictionary.Keys.Free; finally ADictionary.Free; end; except on E: Exception do WriteLn(E.Message); end; Write('Press <ENTER> to continue...'); ReadLn; end.
QC #: Date Reported: Area:
66781 9/15/2008 IDE\Project Management\Project Source
Description: Steps:
[QC Short Description]
Project file (.dproj) always turn to modifed state when first open

[QC Description]
When I open a project file (MyPackage.dproj) in Delphi 2009 IDE, the state of the file turn to modified once I open. I didn't make any changes to the project yet. After investigate the problem, it was caused by "LIB Prefix" setting in Project Options.

I have a project group with 80++ projects. All projects has LIB Prefix setting. If I close the project group, I have to answer 80++ dialogs.
QC Entry 66781
Please follow the steps to replay the problem: 1. Extract the zip attachment. 2. Open Delphi 2009 IDE. 3. Open the MyPackage.dproj using Delphi 2009 IDE 4. Click File | Close All to close all projects. 5. A dialog prompted if you want to save the project. 6. Press button "No" to ignore it. Remove the "LIB Prefix" and the problem will gone: 7. Re-open MyPackage.dproj again. 8. Click Project | Options..., select "Description" page and delete text in "LIB Prefix". 9. Press OK to close Project Options dialog 10. Save and close the package. 11. Re-open MyPackage.dproj again. 12. Click File | Close All to close all projects and no dialog prompted.
QC #: Date Reported: Area:
66856 9/16/2008 IDE\Object Inspector
Description: Steps:
[QC Short Description]
Separator line of Object Inspector between property name and value not in the correct position when use customize desktop layout

[QC Description]
Separator line of Object Inspector between property name and value not in the correct position when use customize desktop layout.
QC Entry 66856
1. Copy the attached Default Layout2.dst file into %APPDATA%\CodeGear\BDS\7.0
2. Start IDE with the Default Layout.
3. New VCL Forms application (to make OI show something)
4. Switch back and forth between Default Layout and Default Layout2.

When switching from Default Layout2 to Default Layout you'll will see the separator line of object Inspector not in correct position, column width of property name is large, proerty value is small. If you reload Default Layout (without switching), you'll see it use the correct position.
QC #: Date Reported: Area:
66858 9/16/2008 IDE\Code Editor\Error Insight
Description: Steps:
[QC Short Description]
ErrorInsight shows unnecessary error when code contains generics

[QC Description]
ErrorInsight shows unnecessary error when code contains generics. In the code at "Steps to Reproduce", you see an error "Undeclared identifier 'T' at line 12 and 20" even this code can be compiled.
QC Entry 66858
create a unit as follows: unit Unit1; interface uses Classes; type ITest<T> = interface procedure YieldBreak; end; TEnumProcedure<T> = reference to procedure(const EnumMaker: ITest<T>); //error TTest<T> = class procedure TestMethod; end; implementation procedure TTest<T>.TestMethod; //error begin end; end.
QC #: Date Reported: Area:
66859 9/16/2008 IDE\Code Editor\Error Insight
Description: Steps:
[QC Short Description]
ErrorInsight shows unnecessary error when code contains generics with type constraints.

[QC Description]
ErrorInsight shows unnecessary error when code contains generics. In the code at "Steps to Reproduce", you see an error "Undeclared identifier 'Count' at line 21" even this code can be compiled.

QC Entry 66859
create a unit as follows:

interface

uses
Classes;

type
TTest<T: TList> = Class
procedure TestMethod;
end;


implementation

procedure TTest<T>.TestMethod;
var
list: T;
i: Integer;
begin
i := list.Count; //error
end;
QC #: Date Reported: Area:
66869 9/17/2008 Midas
Description: Steps:
[QC Short Description]
TClientDataSet.SetOptionalParam is not working

[QC Description]
We have use TClientDataSet.SetOptionalParam methods to add custom information to a data packet. However, this function is not working at all in Delphi 2009. It is working fine in Delphi 2007 or below.

Please run the test case below to replay.
QC Entry 66869
TDBXTiburonBugsSuite.Native.DB.Test.exe connection=MSSQLCONNECTION -s:oTestRaid_265351

---

var D: TClientDataSet;
V: variant;
begin
D := TClientDataSet.Create(nil);
try
D.FieldDefs.Add('Name', ftString, 20);
D.CreateDataSet;

D.SetOptionalParam('ID', 'A01', True);
V := D.GetOptionalParam('ID');
CheckEquals('A01', V);

D.SetOptionalParam('ID', '001', True);
V := D.GetOptionalParam('ID');
CheckEquals('001', V);
finally
D.Free;
end;
end;
QC #: Date Reported: Area:
66892 9/17/2008 VCL\Core VCL Classes\TApplication
Description: Steps:
[QC Short Description]
Closing forms deactivates the application

[QC Description]
Closing two forms in the test app deactives the program. Any other running app will become active. The test app now appears behind the "other" app.

Tested on XP and Vista. It works fine with D2007.
QC Entry 66892
- make sure there's a program running (Windows Explorer, for example) - run the attached program - Click the button, Form 2 appears - Click the button on Form 2 --> Form3 appears - Close Form 3 - Close Form 2 Expected: the program is now still the active application (ie. it has focus) Observed: the program which was running before starting the test program is now active.
QC #: Date Reported: Area:
66901 9/17/2008 VCL\Core VCL Classes\Streaming
Description: Steps:
[QC Short Description]
TStreamWriter writing to File does not write UTF8 BOM

[QC Description]
We are using the new TStreamWriter class to write data to files. The problem is that if we specify encoding to be UTF8, the system does not write the BOM. This is different to other components - i.e. Memo.Lines.SaveToFile function writes the BOM.



QC Entry 66901
Create a new application, and place a button onto it, and copy this code into it... procedure TForm1.Button2Click(Sender: TObject); var TmpData: String; TmpStreamWriter: TStreamWriter; begin TmpData := 'ABCDE'; TmpStreamWriter := TStreamWriter.Create('C:\TEST_FILE_0002.txt', False, TEncoding.UTF8); TmpStreamWriter.Write(TmpData); TmpStreamWriter.Flush; TmpStreamWriter.Free; ShowMessage('Completed!'); end; Now, when the file is written, I would expect it to be 8 bytes long - 5 bytes for "ABCDE", plus 3 bytes for BOM.
QC #: Date Reported: Area:
66902 9/17/2008 VCL\Core VCL Classes\Streaming
Description: Steps:
[QC Short Description]
TStreamReader does not read correctly UTF8 Encoded file

[QC Description]
Using the new TStreamReader class, it appears that the ReadToEnd function is not working correctly on UTF8 encoded files... The length of the data read is always one character more.
QC Entry 66902
Create new application, and place the following code... procedure TForm1.Button3Click(Sender: TObject); var TmpData: String; TmpStreamReader: TStreamReader; begin TmpStreamReader := TStreamReader.Create('C:\TEST_FILE_0003.txt', TEncoding.UTF8); TmpData := TmpStreamReader.ReadToEnd; TmpStreamReader.Free; ShowMessage('File Length is: ' + IntToStr(Length(TmpData)) + #13#10 + 'Data is: "' + TmpData + '"'); end; Now, create new text file with notepad, put "ABCDE" into it, with no other line line breaks etc. Save the file with notepad in UTF8 format. (Check the file - it will be 8 bytes long - 3 bytes for BOM, plus 5 bytes for "ABCDE"). Now, run the application, and the data read from the file is 6 characters long!!!
QC #: Date Reported: Area:
66903 9/17/2008 VCL
Description: Steps:
[QC Short Description]
Button Controls do not draw caption in correct font color

[QC Description]
D2009 does not allow you to change the Font Color of any Button. (TButton, TBitBtn and TSpeedButton). You can change the font size, italics, underline - all other properties - but not the color!!!
QC Entry 66903
Create new application. Plase TButton, TBitBtn and TSpeedButton on the form. Change the Font properties (Font name, size, style, color etc.) This works except for the color - can not have colored labels anymore!!!


-----

TG: Addional notes: TBitBtn and TSpeedButton on D2007 were capable of displaying other font colors with themes enabled. In 2009, they do not. TButton as far as i can tell never supported Font.Color.

1. New VCL Forms app.
2. Drop a TBitBtn.
3. Drop a TSpeedButton.
4. Set the Font.Color for both to clRed.
//exp: The color changed.
//act: the color remains black.

(Test with both Runttime themes on and off)
QC #: Date Reported: Area:
66966 9/19/2008 Compiler\Delphi\Execution
Description: Steps:
Compiler Fails with F2084 Internal Error : GPFC00000FD-004331F4-0 when referencing records with properties

QC Entry 66966
Compile the attached unit below.

See the following compile-time error indicating failure.

Fatal: F2084 Internal Error: GPFC00000FD-0043322F-0


unit uBTS265375;

interface

type
TypeData = record
function GetFoo: TypeData;
property Foo: TypeData read GetFoo;
end;

TypeArray = array of TypeData;

procedure CrashBDS (var AArray: TypeArray; AValue: TypeData; I: Integer);

implementation

procedure CrashBDS (var AArray: TypeArray; AValue: TypeData; I: Integer);
begin
AArray [I] := AValue;
end;

function TypeData.GetFoo: TypeData;
begin
end;

end.

QC #: Date Reported: Area:
67020 9/21/2008 Compiler\Delphi\Generics
Description: Steps:
[QC Short Description]
Properties with virtual methods cause AVs with generics

[QC Description]
If a class has a property with virtual accessor methods, calling the property from a generic class causes an AV.
QC Entry 67020
Compile the attached program (copied below). //EXP: PASS //ACT: FAIL: EAccessViolation at address 0040A974 in module 'GenericPropertiesAV.exe'. Write of address 54A38090. program GenericPropertiesAV; {$APPTYPE CONSOLE} uses SysUtils; type TObj = class(TObject) public function GetText: string; virtual; // No problem if not virtual property Text: string read GetText; end; TUserObj<SOMETYPE: constructor, TObj> = class(TObject) public procedure DoSomething; end; function TObj.GetText: string; begin Result := 'PASS'; end; procedure TUserObj<SOMETYPE>.DoSomething; var Obj: SOMETYPE; Str: string; begin Obj := SOMETYPE.Create; // WriteLn(Obj.GetText); // no problem calling method WriteLn(Obj.Text); // but AV using property end; var UserObj: TUserObj<TObj>; begin try UserObj := TUserObj<TObj>.Create; try UserObj.DoSomething; ReadLn; finally UserObj.Free; end; except on E: Exception do begin WriteLn('FAIL: ' + E.ClassName + ' ' + E.Message); ReadLn; end; end; end.
QC #: Date Reported: Area:
67045 9/22/2008 Compiler\Delphi
Description: Steps:
[QC Short Description]
Generic type as event parameter - F2084 Internal Error: TI701

[QC Description]
When I use a generic type in my event, I get an error.
QC Entry 67045
Compile the attached application below.

See the following compile-time error indicating failure.

Fatal: F2084 Internal Error: TI701


program BTS265415;
{ Generic type as event parameter - F2084 Internal Error: TI701
}

{$APPTYPE CONSOLE}

uses
SysUtils,
Classes,
Generics.Collections;

type
TSomeEvent = procedure (Sender: TObject;
Current, Max: Integer; CurrentList: TDictionary<string, string>) of object;

TAThread = class(TThread)
private
FOnSomeEvent: TSomeEvent;
public
property OnSomeEvent: TSomeEvent read FOnSomeEvent write FOnSomeEvent;
end;

begin
WriteLn('PASS'); // PASS on compile
end.
QC #: Date Reported: Area:
67101 9/23/2008 VCL\Printing
Description: Steps:
[QC Short Description]
Assignprn in Delphi2009

[QC Description]
This code, which works in D2007, prints garbage in d2009:

procedure TForm1.Button1Click(Sender: TObject);
var
MyFile: TextFile;
I: integer;
begin
AssignPrn(MyFile);
Rewrite(MyFile);
for I :=0 to Memo1.Lines.Count do
Writeln(MyFile, Memo1.Lines[I]);
System.CloseFile(MyFile);


end;
QC Entry 67101
 
QC #: Date Reported: Area:
67121 9/24/2008 Database\DBExpress
Description: Steps:
[QC Short Description]
D2009 dbExpress wrongly uses WideString where D20007 used String

[QC Description]
Our Oracle applications in D2007 use String for *all* fields of all tables and stored procedures, never WideString.

Just recompiling in D2009 *all* querys and stored procedures fail with type mismatch errors "expecting String actual WideString".

My guess is that D2009 is wrongly identifying our database as Unicode. I don't know how D2009 identifies if an Oracle10 database is Unicode-enabled or not, but in our case it must be doing it the wrong way.
I think the right way should be something like:

SELECT value FROM nls_database_parameters
where parameter = 'NLS_CHARACTERSET'

In our database that query returns WE8ISO8859P15. Unless that query returns UTF8, UTF16... you shouldn't force us to use Widestrings.

For us using Widestrings throughout all our applications, combined with QC 4790 is a real showstopper.

(An alternative solution would be to add a property SqlConnection.UseUnicode with values Always/Never/Default, so users could decide themselves if they want to use WideStrings).

Example of a query in D2007:

object ConexionOracle: TSQLConnection
ConnectionName = 'Oracledesarrollo'
DriverName = 'Oracle'
GetDriverFunc = 'getSQLDriverORACLE'
LibraryName = 'dbxora30.dll'
Params.Strings = (
'DriverName=Oracle'
'DriverUnit=DBXDynalink'

'DriverPackageLoader=TDBXDynalinkDriverLoader,DBXDynalinkDriver10' +
'0.bpl'

'DriverAssemblyLoader=Borland.Data.TDBXDynalinkDriverLoader,Borla' +
'nd.Data.DbxDynalinkDriver,Version=11.0.5000.0,Culture=neutral,Pu' +
'blicKeyToken=91d62ebb5b0d1b1b'

'MetaDataPackageLoader=TDBXOracleMetaDataCommandFactory,DbxReadOn' +
'lyMetaData100.bpl'

'MetaDataAssemblyLoader=Borland.Data.TDBXOracleMetaDataCommandFac' +
'tory,Borland.Data.DbxReadOnlyMetaData,Version=11.0.5000.0,Cultur' +
'e=neutral,PublicKeyToken=91d62ebb5b0d1b1b'
'DataBase=DESARROLLO'
'User_Name=xxxx'
'Password=xxxxx'
'BlobSize=-1'
'ErrorResourceFile='
'LocaleCode=0000'
'Oracle TransIsolation=ReadCommited'
'RowsetSize=20'
'OS Authentication=False'
'Multiple Transaction=False'
'Trim Char=False'
'Decimal Separator=,')
TableScope = [tsSynonym, tsTable, tsView]
VendorLib = 'OCI.DLL'
Left = 88
Top = 24
end
object QRoles: TSQLQuery
MaxBlobSize = -1
Params = <>
SQL.Strings = (
'SELECT ROLE'
'FROM SESSION_ROLES'
'')
SQLConnection = ConexionOracle
Left = 216
Top = 24
object QRolesROLE: TStringField
FieldName = 'ROLE'
Size = 30
end
end

As you can see, the field is returned as string. If I try to repeat that in D2009 I get this:


object SQLConnection1: TSQLConnection
ConnectionName = 'Oracledesarrollo'
DriverName = 'ORACLE'
GetDriverFunc = 'getSQLDriverORACLE'
LibraryName = 'dbxora.dll'
Params.Strings = (
'drivername=ORACLE'
'database=DESARROLLO'
'user_name=XXXXX'
'password=XXXXX'
'blobsize=-1'
'localecode=0000'
'oracle transisolation=ReadCommited'
'rowsetsize=20'
'os authentication=False'
'multiple transaction=False'
'trim char=False'
'decimal separator=,')
VendorLib = 'oci.dll'
Connected = True
Left = 128
Top = 80
end
object SQLQuery1: TSQLQuery
MaxBlobSize = -1
Params = <>
SQL.Strings = (
'SELECT ROLE'
'FROM SESSION_ROLES')
SQLConnection = SQLConnection1
Left = 216
Top = 80
object SQLQuery1ROLE: TWideStringField
FieldName = 'ROLE'
Required = True
Size = 30
end
end


QC Entry 67121
TDBXWeaverBugsSuite.Native.DB.Test.exe connection=mssqlconnection -s:TestRaid_265464

I can't know what you need to reproduce it because I don't know what mechanism dbExpress uses to decide if a database is Unicode.

I think it's very likely that if you create a Oracle10g database with characterset WE8ISO8859P15 and connect using this client:

http://download.oracle.com/otn/nt/instantclient/10204/instantclient-basic-win32-10.2.0.4.zip

you can reproduce it.
QC #: Date Reported: Area:
67134 9/24/2008 VCL\Core VCL Classes\TForm
Description: Steps:
[QC Short Description]
Cannot show an Exception or Message with a StayOnTop form, if an other form is active

[QC Description]
If there is a TopMost window in the application, and the active form is not this form, it is impossible to show a message or exception above this form. No normalization (NormalizeTopMosts) or workaround seems to work. The only way to prevent is activating the TopMost form before showing a message. While this can be achieved for message boxes, it is impractical with exceptions. Please run the attached project if you want to see a demonstration.

I am sure that the type will seem to be exaggerated at first, but end users are killing the application, since it gives the impression to have been freezed. Hence, data loss, total failure.

More info:
Exceptions, Application.MessageBox, ShowMessage, all implicitly call NormalizeTopMosts. DoNormalizeTopMosts procedure enumerates the top level windows in the GetTopMostWindows callback. This callback function implements a test to see if a top level window belongs to the application. The test is;
(GetWindow(Handle, GW_OWNER) = Application.Handle)
The thing is, owner of forms is not the application window but the main form, if MainFormOnTaskbar is true. Besides that, the owner form can be any form because of the PopupParent property. There needs to be done another test to find out if a top level window belongs to the application.
QC Entry 67134
As per the attachment
QC #: Date Reported: Area:
67172 9/25/2008 Compiler\Delphi\Generics
Description: Steps:
[QC Short Description]
Generics F2084 Erreur interne : AV06A8B28A-R00000000-0

[QC Description]
Compiler error happening in D2009 for the following code (see Steps).
QC Entry 67172
Compile the attached application below.

See the following compile-time error indicating failure.

Fatal: F2084 Internal Error: AV00435BDE-R00000000-0

The error does not occur if the line marked #1 is removed or if the line marked #2 is changed to read as folows.

TCompilerCrash<T: constructor>=class

Perhaps an error message should be displayed for the line marked #1 when a suitable constraint is not present.

program BTS266015;

{$APPTYPE CONSOLE}

uses
SysUtils;

type
TCompilerCrash<T> = class //#2//
FObject : T;
constructor Create;
end;

constructor TCompilerCrash<T>.Create;
begin
inherited;
FObject:=T.Create; //#1//
end;


begin
WriteLn('PASS'); //PASS on compile//
end.
QC #: Date Reported: Area:
67193 9/26/2008 IDE\Dialogs\Environment Options
Description: Steps:
[QC Short Description]
Cannot use environement variables in Shared Repository and Default project paths

[QC Description]
I'm trying to use an environment variable in the IDE options dialog at:

Environment Options - Directories - Shared Repository / Default project like: $(DELPHI120DATA)

After pressing OK I first get this error:

Error: Default project directory $(DELPHI120DATA)\ is invalid..
Details: [5001BE04]{rtl120.bpl } SysUtils.ForceDirectories (Line 6573,
"SysUtils.pas" + 6) + $2
[..]

The directory is not invalid. It exists on the harddisk and is accessible. When pressing the three bullet button on the right side of the edit, it correctly opens the location where the variable points to.

After confirming this error dialog and pressing OK to close the options dialog, I get an AV:

Error : Access violation at address 21092194 in module 'itecore120.bpl'.
Read of address 00000008.
Details: [21092194]{itecore120.bpl} ITEGridFont.TITEGridFonts.GetCount
(Line 107, "ITEGridFont.pas" + 0) + $0
[210928EA]{itecore120.bpl} ITEGridFont.TITEGridFonts.Merge (Line 246,
"ITEGridFont.pas" + 2) + $2
[..]

Could you please check this?

Michael
QC Entry 67193
Start IDE
Tools | Options | Environment Variables
Click New button
Variable name: FOOVAR
Variable value: c:\
OK
OK
Tools | Options | Environment Options
For "Default project" enter $(FOOVAR)
OK

Error
QC #: Date Reported: Area:
67210 9/26/2008 Database\dbExpressCore
Description: Steps:
[QC Short Description]
TSQLConnection Driver property and DBX .ini file deployment

[QC Description]
dbExpress applications compiled with Delphi 2009 now require the presence of the dbxdrivers.ini and dbxconnections.ini files (either in the current directory or with information specified in the registry?).

It used to be possible to deploy applications compiled with Delphi without the dbxdrivers.ini and dbxconnections.ini (and this should still be possible, of course).
QC Entry 67210
Produce a VCL Forms application with dbExpress (a TSQLConnection component pointing to some database is enough) and try to deploy it to a clean machine - without Delphi on it.
QC #: Date Reported: Area:
67233 9/26/2008 Database\dbExpressCore
Description: Steps:
[QC Short Description]
AutoUnloadDriver is not working as is

[QC Description]
In Delphi 2009 DBX4 framework, there is a new property TDBXPropertyNames.AutoUnloadDriver. This is state in the DBXCommon.pas about the property:

"If set to true, dynalink drivers will automatically unload their dll, when there are no longer any open connections that use the driver."

I expect setting the property to true will make the database connection library to be unloaded when connection is closed.

However, I find no way to activate this function thru current DBX4 implementation.

After tracing the DBX source code, I found the cause of the problem. The Dynalink Driver class has the following constructor:

constructor TDBXDynalinkDriver.Create(DBXDriverDef: TDBXDriverDef; DBXDriverLoader: TDBXDynalinkDriverCommonLoaderClass);
begin
inherited Create(DBXDriverDef);
FDriverLoaderClass := DBXDriverLoader;
// '' makes this the default command factory.
//
AddCommandFactory('', CreateDynalinkCommand);
if (DriverProperties = nil) or not DriverProperties.GetBoolean(TDBXPropertyNames.AutoUnloadDriver) then
CacheUntilFinalization;
end;

To make AutoUnloadDriver work as it should, the clue is to avoid invoke CacheUntilFinalization in the constructor. In order to do that, we must make sure DriverProperties is not nil and AutoUnloadDriver property has value "True".
QC Entry 67233
1. Create a new VCL application 2. Drop a TSQLConnection (SQLConnection1) instance and define properties for Interbase connection. To enable AutoUnloadDriver, add a new param (AutoUnloadDriver=True) into SQLConnection.Params 3. Drop a TButton (Button1) and write OnClick event: SQLConnection1.Open; 4. Drop another TButton (Button2) and write OnClick event: SQLConnection1.Close; 5. Run the application in debug mode. Make sure you bring out a "Event Log" debug window to trace how the database connection dll is loaded and unloaded. 6. Press Button1 to open the database connection, the Event Log windows will show database connection library has loaded. 7. Press Button2 to Close the database connection, the event log windows show nothing about the database connection library. 8. Close the application will only unload the database connection library.
QC #: Date Reported: Area:
67255 9/28/2008 VCL\Graphics\TPNGImage
Description: Steps:
[QC Short Description]
Birmap.Assign(PNG), Palette is lost

[QC Description]
256 color png assign to bitmap cause palette lost
QC Entry 67255
procedure TForm1.Button1Click(Sender: TObject); var Bitmap: TBitmap; PNG: TPngImage; begin PNG := TPNGImage.Create; PNG.LoadFromFile('C:\256color.png'); Bitmap := TBitmap.Create; Bitmap.Assign(PNG); Bitmap.SaveToFile('C:\new.bmp'); Bitmap.Free; PNG.Free; end;
QC #: Date Reported: Area:
67271 9/28/2008 IDE\Open Tools API
Description: Steps:
[QC Short Description]
IOTAEditBlock.Text returns corrupted UTF-8 instead of the declared string/UnicodeString type

[QC Description]
IOTAEditBlock.Text is declared to return the selection as a string/UnicodeString, but it returns something much closer to each byte of a UTF-8 encoding of the selection as a separate character, so most characters end up corrupted.

Ideally, this function would convert the edit block's bytes into a valid string/UnicodeString, so the implementation matches the declaration.
QC Entry 67271
Open attached package, click install Type/paste any unicode or high-ASCII character into a source editor (example: À, or unicode char U+0246) Select that single character Help, Execute Wizard Expected: ShowMessage dialog with just the selected character in the message Actual: Currupt string shows instead
QC #: Date Reported: Area:
67279 9/28/2008 IDE\Code Editor\Error Insight
Description: Steps:
[QC Short Description]
Error insight cannot find properties of constrained generic classes

[QC Description]
If you constrain a generic class to only allow use of a particular class + it's descendants, eg.

TManager<T: TComponent>

then when you try to refer to a variable that is of type T inside the methods of the class, error insight cannot find the properties of T that you know T has (due to the constraint).

eg. For T constrained to TComponent, you cannot get autocompletion for TComponent properties/methods, such as Name, ComponentState + an error is reported by error insight when you do use these properties/methods, although code compiles ok.
QC Entry 67279
1. New VCL Forms app.
2. Add Generics.Collections to the uses clause.
3. Copy the following code and paste it into the implementation section.

type
TManager<T: TComponent> =class(TComponent)
clientList: TList<T>;
public
procedure RegisterClient(aClient: T);
procedure UnRegisterClient(aClient: T);
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
function DisplayClientList: String;
end;


{ TManager<T> }
constructor TManager<T>.Create;
begin
inherited;
clientList:=TList<T>.Create;
end;

destructor TManager<T>.Destroy;
begin
clientList.Free;
inherited;
end;

function TManager<T>.DisplayClientList: String;
var
i:integer;
begin
if clientList.Count>0 then
Result:=clientList[0].name;
for I := 1 to clientList.count - 1 do
Result:=Result+', '+clientList[i].name;

//********** "name" will be highlighted in red **********
// *********code completion won't work for clientList[i]. **********
//********** but code will compile ok *************

end;

procedure TManager<T>.RegisterClient(aClient: T);
begin
if clientList.IndexOf(aClient)<0 then
clientList.Add(aClient);
end;

procedure TManager<T>.UnRegisterClient(aClient: T);
begin
clientList.Remove(aClient);
end;
QC #: Date Reported: Area:
67317 9/29/2008 RTL\Delphi\Other RTL
Description: Steps:
[QC Short Description]
TArray.BinarySearch<T> is severely flawed

[QC Description]
TArray.BinarySearch<T> and TList<T>.BinarySearch (which uses the former) produce wrong results. These are so wrong that the function is totally unusable.

See Steps for code that displays this.

The following code produces correct results:

class function TArray.BinarySearch<T>(const Values: array of T; const Item: T;
out FoundIndex: Integer; const Comparer: IComparer<T>; Index,
Count: Integer): Boolean;
var
L, H: Integer;
mid, cmp: Integer;
begin
if (Index < Low(Values)) or (Index > High(Values))
or (Index + Count - 1 > High(Values)) or (Count < 0)
or (Index + Count < 0) then
raise EArgumentOutOfRangeException.CreateRes(@sArgumentOutOfRange);
if Count = 0 then
begin
FoundIndex := 0;
Exit(False);
end;

Result := False;
L := Index;
H := Index + Count - 1;
while L <= H do
begin
mid := L + (H - L) shr 1;
cmp := Comparer.Compare(Values[mid], Item);
if cmp < 0 then // mods 09/29/2008 R. Velthuis
L := mid + 1
else
begin
H := mid - 1;
if cmp = 0 then
Result := True;
end;
end;
FoundIndex := L;
end;



QC Entry 67317
IN Delphi, 2009, enter the following console application: program BinarySearchTest; {$APPTYPE CONSOLE} uses Generics.Collections, SysUtils; procedure ShowList(L: TList<Integer>); var I: Integer; begin Writeln; Write(L.Count:5, ': '); for I in L do Write(I:5); Writeln; end; procedure TestBinarySearch; var L: TList<Integer>; I, Index: Integer; Found: Boolean; begin L := TList<Integer>.Create; L.AddRange([1, 2, 2, 3, 5, 8, 8, 8, 9, 10, 10, 17]); ShowList(L); for I := 0 to L[L.Count - 1] do begin Found := L.BinarySearch(I, Index); Write(I:5, ': '); if Found then Writeln('X':5*Index + 5) else Writeln('-':5*Index + 5); end; ShowList(L); Readln; end; begin try TestBinarySearch; except on E: Exception do Writeln(E.ClassName, ': ', E.Message); end; end. Run it. EXP (view this in fixed width font): 12: 1 2 2 3 5 8 8 8 9 10 10 17 0: - 1: X 2: X 3: X 4: - 5: X 6: - 7: - 8: X 9: X 10: X 11: - 12: - 13: - 14: - 15: - 16: - 17: X ACT: See for yourself ("Steps" does not accept any text anymore).
QC #: Date Reported: Area:
67351 9/30/2008 Debugger\Stepping
Description: Steps:
[QC Short Description]
Debugger invokes anonymous method by itself

[QC Description]
The debugger invokes anonymous methods (TProc) by itself.
QC Entry 67351


See comment for additional test case
1. Open the attached project 2. Start the application Sysop note: make sure the Local Variables view is visible (otherwise the issue won't occur) 3. Follow the steps in the project file Expected: The anonymous method is called once. Actual: The anonymous method is called multiple times in the context of the IDE.
QC #: Date Reported: Area:
67485 10/3/2008 Midas\TClientDataSet
Description: Steps:
[QC Short Description]
Property TClientDataSet Filter does not support UNICODE

[QC Description]
Property TClientDataSet Filter does not support UNICODE (see attachment)
QC Entry 67485

Note from Tomohiro Takahashi
<<<<<<<<
Please see comments at QC for more detail.
>>>>>>>>
TDBXWeaverBugsSuite.Native.DB.Test.exe connection=mssqlconnection -s:TestRaid_265735
QC #: Date Reported: Area:
67523 10/4/2008 IDE\Translation Tools\Resource DLL Wizard
Description: Steps:
description update>>>
Delphi, Cpp. Error compiling resource DLL project if there are include files inside RC-file.


>>>
[QC Short Description]
Error compiling resource DLL projects
[QC Description]
String resources, added to resource DLL projects are not compiled
QC Entry 67523
1. Create VCL form application
2. Add RC file with any include to project: for example, file Strings.rc

___Strings.rc___
#include "strings.h"
STRINGTABLE {
IDS_PROJNAME "TEST PROJECT"
}

___Strings.h___
#define IDS_PROJNAME 2000

3. Add new language to project: Project->Languages->Add
4. Compile resource DLL with new language


Result: compile error [Error] E1026 File not found 'Strings.res'
// see on disk into localized project folder: only *.rc, *.rcn files are there; and path to *.h file is not changed into RC file, so it is not found


Workaround: manually copy strings.h into localized project folder.

Note: there is similar behaviour if RC file contains include file from standart include directory of RAD Studio: for reproduce e.g add
#include <winresrc.h>
into any rc file and execute same steps
QC #: Date Reported: Area:
67562 10/6/2008 RTL
Description: Steps:
[QC Short Description]
The codepage of UTF8String can be set to default ANSI code page incorrectly.

[QC Description]
The Concanation of Empty UTF8Strring variable and AnsiChar Literals produces AnsiString(928).

It should be 65001 because Compiler knows the codepage of UTF8String variable.

The substitution to UTF8String does not convert string payload.
The codepage of UTF8String should always be 65001 if it has its payload.
QC Entry 67562


Note from Tomohiro Takahashi
<<<<<<<<<<<<<
Please see comments at QC for more detail.
>>>>>>>>>>>>>
Compile and run the attached application below.

See the following program output indicating failure.

FAIL #1 - RetVal=1252

The value of RetVal will vary depending on the value of the default code page.

program BTS265707;

{$APPTYPE CONSOLE}

uses
SysUtils;

var
Counter: Integer = 0;

function Foo(U8: UTF8String): Integer;
begin
U8 := U8 + AnsiChar(#$F0) + AnsiChar(#$A0) + AnsiChar(#$AE) + AnsiChar(#$B7);
U8 := U8 + AnsiChar(#$E9) + AnsiChar(#$87) + AnsiChar(#$8E);
U8 := U8 + AnsiChar(#$E5) + AnsiChar(#$B1) + AnsiChar(#$8B);
Result := StringCodePage(U8);
end;

procedure Doit;
var
RetVal: Integer;
begin
RetVal := Foo('');
if RetVal = 65001 then // Displays Default ANSI CodePage
Inc(Counter)
else
WriteLn('FAIL #1 - RetVal=', RetVal);

RetVal := Foo('A');
if RetVal = 65001 then // Displays 65001
Inc(Counter)
else
WriteLn('FAIL #2 - RetVal=', RetVal);
end;

begin
try
DoIt;
if Counter = 2 then
WriteLn('PASS');
except
on E: Exception do
WriteLn('FAIL - Exception=', E.Classname, '/', E.Message);
end;
end.
QC #: Date Reported: Area:
67564 10/6/2008 RTL\Delphi
Description: Steps:
[QC Short Description]
Error in TStringBuilder.Replace

[QC Description]
Failed to replace consecutive identical characters.

procedure TfMain.Button2Click(Sender: TObject);
var S : string;
SB : TStringBuilder;
begin
SB := TStringBuilder.Create('Error');
try
S := SB.Replace('r','NEW').ToString;
finally
SB.Free;
end;
end;

Result : S = "ENEWroNEW"
There must be : s = "ENEWNEWoNEW"
QC Entry 67564
 
QC #: Date Reported: Area:
67585 10/6/2008 Compiler\Delphi\Generics
Description: Steps:
[QC Short Description]
Access Violation when accessing properties of constrained interfaced generic type

[QC Description]
This is easier to show with an example than to explain. See the Steps and Attachments.
QC Entry 67585
Run the code in the attachment. First, we define a simple object interface with just a single property: type IFoo = interface ... property ID: String read GetID; end; The code defines a generic interface with a constraint on the type: type IBar<T: IFoo> = interface This interface is implemented by TBar<T: IFoo>. This class just has a single field of the generic type: type TBar<T: IFoo> = class(TInterfacedObject, IBar<T>) strict private FItem: T; ... end; Since the generic type in IBar is constrained to be of type IFoo or derived, we should be able to access the ID-property of the FItem field: if (FItem.ID = 'MyID') then // <== run-time error here This compiles fine, but executing it results in an Access Violation or System Exception. If you call the accessor of the property directly however, everything runs fine: if (FItem.GetID = 'MyID') then // <== this runs fine
QC #: Date Reported: Area:
67596 10/6/2008 IDE\Code Editor
Description: Steps:
[QC Short Description]
When use editor's Surround | tryf to reformat codes, all Chinese characters become meanless characters

QC Entry 67596
1. Inside the editor write the following codes : aSL := TStringList.Create; aSL.Add('??'); aSL.Add('?????'); aSL.Add('??'); aSL.Add('???'); aSL.Add('???????'); aSL.Free; 2. Inside the editor selects all the above codes , right click the mouse and select surround | tryf to reformat the codes. 3. The editor will produce codes like the following try aSL := TStringList.Create; aSL.Add('???'); aSL.Add('????????); aSL.Add('???'); aSL.Add('?????); aSL.Add('???????????); aSL.Free; finally end;????'); aSL.Free; end; All TC/SC Chinese characters become meanless characters Please see the attached example
QC #: Date Reported: Area:
67603 10/7/2008 VCL\Standard Controls\TListBox
Description: Steps:
[QC Short Description]
Problem with trancparency of PNG files in TImageList (black borders)

[QC Description]
Hi,

I'm adding some PNG files to a TImageList (24 x 24, ColorDepth cd32bit) to show them up in a TToolbar.

After loading the image files into the image list, I noticed that all images have got a black border instead of a transparent area.

Using Windows XP Pro, SP2/SP3. Themes are enabled for the application and in Windows of course.

This has already been discussed in the CG newsgroups (non-tech, 'PNGComponents question') without any solution yet (Oct. 7 2008)
QC Entry 67603
I've attached a zip files which contains a screen shot of this problem for a quick review. Moreover, the subfolder IMG contains those images which do not work properly. But those are just sample files as others do not work either. I provided some units which show the problem after opening in the IDE: 1) Unit31 was given to me by Rudy Velthuis who tried to reproduce this issue. He used some PNG files from the GlyFX subfolder installed with D2009. You will noticed that there are no black borders on the top toolbar I've added a new image list (MyImageList) and added the files from the attached IMG subfolder and did get no black borders, too, as could be seen in the lower toolbar. 2) So I've created a new form (Unit32) and *copied* the image list (MyImageList) from Unit31 to it - no drawing issues either. 3) I've created a new form (Unit33), added a *new* image list, inserted the PNG files from IMG subfolder and voila, black border are there. So there is really no way to reproduce this problem for sure, however Rudy stated he got black borders in Unit33 on his machine, as well. I even tried to solve this on a different Windows installation with different graphics drivers, to no avail either. I also tried different PNG files, those from the GlyFX subfolder, but did get those black borders again. Of course, I mentioned it already in the description, I do have Themes enabled and have set the image size and color depth before adding any images. OTH, I have used exactly those images in Turbo Delphi Pro with a third party component TPngImageList and TPngObject (the unit CG has include into D2009 to add PNG support) which work without those issues. So I assume that the PNG files themselves are not buggy in any way. Just for the records: this issue is visible in the IDE *and* during runtime. Using one of those images with a TImage control works perfectly without any black borders. Michael
QC #: Date Reported: Area:
67644 10/7/2008 VCL\Ribbon Controls
Description: Steps:
[QC Short Description]
Ribbon form's caption is flickering while resizing the form

[QC Description]
Ribbon form's caption is flickering while resizing the form
QC Entry 67644
Open, compile and run RibbonDemo project
Resize

Act : Ribbon form's caption is flickering
Expt : Ribbon form's caption shouldn't flicker

// note: if you change the window's width by clicking at the left margin, you can see the form's caption flickering. If you use the right margin instead, this will not happen.
QC #: Date Reported: Area:
67658 10/8/2008 AddOn\RAVE
Description: Steps:
[QC Short Description]
AV on loading a Rave report

[QC Description]
I am getting an access violation when trying to load a Rave report from within Delphi 2009 (loaded on Vista SP1).

A previous comment suggested that having more than one printer installed cause Rave not to load and that the suggestion was to reduce the number of printers to 1. This is not an acceptable solution. Rave under Delphi 2006 had no such problem.
QC Entry 67658
 
QC #: Date Reported: Area:
67686 10/8/2008 RTL\Delphi
Description: Steps:
[QC Short Description]
LowerCase() and UpperCase() functions in AnsiStrings unit do not set proper codepage

[QC Description]
The LowerCase() and UpperCase() functions of the AnsiStrings unit do not copy the codepage of the source AnsiString to the resulting AnsiString, thus the result ends up with a random codepage value. Assigning the the AnsiString to UnicodeString or any other string type that requires a codepage conversion thus fails.

Internally, Lowercase() and UpperCase() are not initializing the ECX register (which is used to hold the target codepage for the new string memory) when calling System.@LStrSetLength(), so whatever random value was already in ECX gets used as the codepage.
QC Entry 67686
uses AnsiStrings; var astr : AnsiString; ustr : UnicodeString; cp: Word; begin astr := AnsiStrings.LowerCase('ABCDE'); cp := StringCodePage(astr); // <-- expected 0 or 1252, got random value instead ustr := astr; // <-- conversion to UTF-16 fails, ustr ends up with empty data end;
QC #: Date Reported: Area:
67694 10/8/2008 VCL\Dialog Controls\TPageSetupDialog
Description: Steps:
[QC Short Description]
Printer dialogs shown for wrong printer

[QC Description]
Printer dialog components (e.g. TPageSetupDialog) do not respect Printer.PrinterIndex. This is a new regression in Delphi 2009.

Cause:

The GetPrinter function in Dialogs incorrectly initializes the Offset fields of the returned DeviceNames record as byte offsets, when, according to MSDN, they should be character offsets:

"wDriverOffset
Offset, in characters, from the beginning of this structure..."

Fix:

Replace Longint() casts with character pointer subtraction:

wDriverOffset := Longint(Offset) - Longint(DevNames);
->
wDriverOffset := Offset - PChar(DevNames);
QC Entry 67694
1. Set up two printers in Windows. 2. Drop a TPageSetupDialog component. 3. Run this code: Printer.PrinterIndex := 0; PageSetupDialog1.Execute; Printer.PrinterIndex := 1; PageSetupDialog1.Execute; Expected result: It should show two Page Setup dialogs in succession, one for the first printer, then another for the second printer. (Click the "Printer..." button to see which printer each dialog is associated with.) Actual result: It shows two Page Setup dialogs *for the same printer*. The setting of PrinterIndex is effectively ignored.
QC #: Date Reported: Area:
67709 10/9/2008 Midas\TClientDataSet
Description: Steps:
[QC Short Description]
TClientDataSet.Locate memory leak detected

[QC Description]
The application reports memory leak upon application termination whenever TClientDataSet.Locate function is being called, with MIDASLIB in uses list.

There is no memory leak if MIDASLIB is not in uses list.
QC Entry 67709
Call TClientDataSet.Locate with MidasLib in uses list. Please refer to the attachment for further information.
QC #: Date Reported: Area:
67729 10/9/2008 RTL\Delphi\Pascal Strings
Description: Steps:
[QC Short Description]
Converting Array of String to Variant fails

[QC Description]
Implicit and explicit conversion of an array of string to a variant fails with an EVariantTypeCastError. Needs to be fixed within unit Variants.pas
QC Entry 67729
type TTestArray = array of String; var lArray: TTestArray; lVariant: Variant; begin SetLength(lArray, 1); lArray[0] := 'Hello world'; lVariant := lArray; // works in Delphi 5 to 2007, not in 2009 end; TTestArray = array of AnsiString does work! Resolution: If you look into unit Variants.pas at line 5183 (function DynArrayVarType) you'll notice a special handling for AnsiStrings: if Result = $48 then Result := varString; this needs to be enhanced for UnicodeStrings. Adding if Result = $4A then Result := varUString; everything works as expected.
QC #: Date Reported: Area:
67837 10/13/2008 IDE\Code Browsing
Description: Steps:
[QC Short Description]
IDE crashes on several actions

[QC Description]
We use include files to define the parameters, some variables and variable initialization on some special functions where we need the same basic features.
In this case several actions (which uses the background compiler I think) crashes the IDE without any error message (IDE does not respond anymore.

I managed to create a small test project to reproduce the behaviour. The test project shows an error message in some cases (Access violation in dcc120.dll at address 04CD1B60).

The test project is attached to this QC report.
The include files are striped down to the necessary.
QC Entry 67837
Open project go to MainFrm.pas then in function test "Ctrl + Left click on "abcd" -> IDE does not respond anymore or type "string(" somwhere in function -> Access violation in dcc120.dll
QC #: Date Reported: Area:
67879 10/14/2008 VCL\Win 32 Controls\THeaderControl
Description: Steps:
[QC Short Description]
OnSectionCheck event not triggered

[QC Description]
When you select or deselect a header checkbox the event is not triggered.

TCustomHeaderControl.CNNotify sets the Checked property but its setter doens't trigger the event....
QC Entry 67879
1. Create a VCL application 2. add a header control 3. turn checked on 4 add a section with a checkbox 5. handle OnSectionCheck for the checkbox --- code is never called
QC #: Date Reported: Area:
67891 10/14/2008 Database\TField\TStringField\TWideStringField
Description: Steps:
[QC Short Description]
TWideStringField.IsNull returns wrong result

[QC Description]
TWideStringField.IsNull method provides wrong results in Delphi 2009, and works differently in comparison to previous Delphi versions.

When assigning an empty string to a WideStringField it returns True in 2009, but False in 2007.
QC Entry 67891
TDBXWeaverBugsSuite.Native.DB.Test.exe connection=mssqlconnection -s:TestRaid_265858

Run the attached sample and click Test. See how the AnsiStringIsNull and WideStringIsNull fields are filled.

The attached archive also contains screenshots with the results for different Delphi versions.
QC #: Date Reported: Area:
67991 10/16/2008 RTL
Description: Steps:
[QC Short Description]
MatchesMask still returns false positives.

[QC Description]
The following console program displays OK in Delphi 2007 and Wrong in Delphi 2009:

program Project5;
{$APPTYPE CONSOLE}
uses
SysUtils, Masks;
begin
if MatchesMask('Test', '*.*') then WriteLn('Wrong')
else WriteLn('OK');
ReadLn;
end.
QC Entry 67991
See description.
QC #: Date Reported: Area:
68001 10/17/2008 IDE\Form Designer
Description: Steps:
[QC Short Description]
Cannot switch between design and code using F12

[QC Description]
Hi,

I've attached three .pas and their appropriate .dfm files. No project available and necessary for this issue.

When opening all three units (.pas files) from the file menu, using open, selecting all three units, all files are loaded into the IDE (did not test a single file so far).

After loading, I can see Unit32 (may differ in other user's IDEs).

Now, I would like to see its according form, so I'm using F12 to switch, but nothing happens.

I can switch using the tab 'Design' on the bottom of the code editor, but so far I was used to do this by pressing the F12 key.

OTH when loading a project it works perfectly. I don't know if this issue only happens when a project file is missing.
QC Entry 68001
1) unzip attachment into a folder

1a) open a new VCL Project
1b) turn ON Save Project Desktop..
1c) Save Project, and Close IDE (with project still open)

1d) reopen the IDE (project should be open)

1e) File | Close All

2) Use menu file-open, select all three units and open them

3) the IDE now shows the coding of Unit32 (or any other one). Or switch to one of the other units and go on with 4)

4) Press F12 to switch into design mode

Nothing happens (at least in my IDE/installation)

From Peter Below in the comments of QC68001:

I can reproduce the problem, if no project is open (File->Close all before opening the units). D2009, fully docked view, somewhat rearranged, ModelMaker Code Explorer installed.

If I look at the View menu the Unit..., Forms..., Toggle unit/form entries are grayed.

If a project is loaded F12 works for the units even though they are not part of the project.
QC #: Date Reported: Area:
68002 10/17/2008 VCL\Additional Controls\TButtonedEdit
Description: Steps:
[QC Short Description]
TButtonEdit image paints wrongly when clicking into the edit

[QC Description]
Hi,

I encountered an issue with the right (left?) image of a TButtonEdit when in read-only mode.

After clicking into the edit field, the right button image is painted over with the edit's background color.

After the edit looses its focus, the image is painted correctly.

Please see attached sample project and screenshot.

PS I've chosen TEdit as Area becase TButtonEdit is missing ar at least I did not found it.
QC Entry 68002
1) Unzip attached project and open it. 2) run the application and click into the (read-only) input field. 3) you will now see, that the image of the right button is painted over.
QC #: Date Reported: Area:
68016 10/17/2008 IDE\Code Editor\Error Insight
Description: Steps:
[QC Short Description]
IDE crashes when renaming identificator

[QC Description]
Delphi crashed when I tried to rename constraint.
QC Entry 68016
1. Open attached project. 2. Go to ImplPlugin.pas unit. 3. Scroll down to declaration "TEnumerator<T: class> = record" in TPluginModules class. 4. Try to rename "T" to, say, "Param". Select T with the mouse and quicly type "Param". 5. IDE will crash after 1-2 seconds.
QC #: Date Reported: Area:
68023 10/17/2008 IDE\Project Management\Project Manager
Description: Steps:
[QC Short Description]
Build Events Being Reformatted when opening project causing errors

[QC Description]
Opening a D2009 Project that uses the build events, will see the commands being reformatted to a single line, causing errors when compiling.

The lines have to be broken back out, but when reopening the project, they are changed back to a single line.
QC Entry 68023
1) Create a new VCL Application. 2) Save the project 3) Right-Click on Build Configurations in Project Manager and select Edit. 4) Select Build Events. 5) Enter multiple commands: Example: DEL "PATHTOPROJECTEXE\Project.EXE" BRCC32 "PATHTOPROJECTEXE\ProgramManifest.RC" 6) Click OK 7) Save Project 8) Close Project 9) Reopen Project 10) Right-Click on Build Configurations in Project Manager and select Edit. 11) Select Build Events. 12) Notice the statements are now combined as one, causing build errors.
QC #: Date Reported: Area:
68031 10/17/2008 Midas\TClientDataSet
Description: Steps:
[QC Short Description]
ftWideMemo data loss

[QC Description]
When Loading an ftWideMemo field from an xml file,
if the field contains unicode characters followed by ansi characters
the last ansicharacter is truncated.

This code illustrates the problem.

var
f : tfielddef;
s : string;
cds : tclientdataset;
begin
cds := tclientdataset.Create(nil);

f := cds.FieldDefs.AddFieldDef;
f.Name := 'field1';
f.DataType := ftWideMemo;
cds.CreateDataSet;

s := #964#949#963#964 + 'x';

cds.Open;
cds.Append;
cds['field1'] := s;
cds.Post;

//saving using any encoding is OK - the problem is during loading of data
cds.SaveToFile('test.xml', dfxml);
//cds.SaveToFile('test.xml', dfXMLUTF8);
//cds.SaveToFile('test.xml', dfBinary);

cds.loadfromfile('test.xml'); //PROBLEM HERE
cds.open;
if s = cds['field1'] then
showmessage('OK') //EXPECTED RESULT
else
showmessage( cds['field1'] + ' <> ' + s); //ACTUAL RESULT
end;
QC Entry 68031
Run the attached application.
QC #: Date Reported: Area:
68045 10/18/2008 Database\ADO
Description: Steps:
[QC Short Description]
TADOQuery/Table converts empty string to null

[QC Description]
The command
adotable1['varchar_field'] := '';
converts the empty string to null

This is not desirable and it is different from D7 and D2007.
QC Entry 68045
TDBXWeaverBugsSuite.Native.DB.Test.exe connection=mssqlconnection -s:TestRaid_265947

==or==

Connect a TADOTable to any table (e.g. MS Access, MS SQL Server) that has at least a varchar field and one row.

Open the table, edit the varchar field and assign an empty string to it.

e.g.
adotable1.open;
adotable1.edit;
adotable1['varchar_field'] := '';
adotable1.post;

if adotable1['varchar_field'] = '' then
showmessage('OK') //expected
else
showmessage('PROBLEM') //actual


QC #: Date Reported: Area:
68107 10/20/2008 IDE\Dialogs\Project Options
Description: Steps:
[QC Short Description]
project option dialog - version info autoscrolls

[QC Description]
The version information section of the project options dialogue had a grid with 2 columns. The descriptions and the values.
If I click into one of the value fields it auto scrolls so far that the descriptions are no longer visible, even if there had been enough place for both columns to be visible. This means I need to constantly scroll left to see what the line means.
QC Entry 68107
1. start or open some simple Win32 project 2. open project options dialogue 3. go to the version info page 4. set version info to be included (btw. in the german edition this text is truncated!) 5. go to the grid and enter something, see it constantly to be scrolled (this is under W2K SP4)
QC #: Date Reported: Area:
68123 10/20/2008 RTL\Delphi\Format + Float
Description: Steps:
[QC Short Description]
function StrToIntDef give an incorrect result

[QC Description]
When unicode string is chinese or japanese. The function StrToIntDef will give an incorrect result in some case.

for example

var
WChar: WideChar;
begin
WChar := WideChar($4e38);
ShowMessage(IntToStr(StrToIntDef(WChar, 0)));
end;

$4e38 is a chinese charator '?', it is not a numeral charator.

The correct result should be 0. But in fact StrToIntDef return 8.





QC Entry 68123
The following code should display a window with message '0'. var WChar: WideChar; begin WChar := WideChar($4e38); ShowMessage(IntToStr(StrToIntDef(WChar, 0))); end;
QC #: Date Reported: Area:
68209 10/23/2008 VCL\Additional Controls\TSplitter
Description: Steps:
[QC Short Description]
AlignWithMargins and Splitter

[QC Description]
Splitter does not find his related control if control has property AlignWithMargins = true. This is since D2006 or earlier.
QC Entry 68209
Put a panel and a splitter on a form. Align to alLeft. AlignWithMargins of the panel to true. Run. Move the splitter. Nothing happen's.
QC #: Date Reported: Area:
68216 10/23/2008 RTL\Delphi\Other RTL
Description: Steps:
[QC Short Description]
TStringStream.ReadString doesn't change position of stream

[QC Description]
12.0.3210.17555.2

QC Entry 68216
program Project1; {$APPTYPE CONSOLE} uses SysUtils, Classes; const s1 = 'test1'; s2 = 'test2'; s3 = 'test3'; var k1,k2,k3: string; begin with TStringStream.Create(s1+s2+s3) do try try k1:= ReadString(Length(s1)); k2:= ReadString(Length(s2)); k3:= ReadString(Length(s3)); if Position = 0 then raise Exception.Create( 'actual : position = '+inttostr(Position)+', k1 = '+k1+', k2 = '+k2+', k3 = '+k3+sLineBreak+ 'expected: position = '+inttostr(length(s1+s2+s3))+', k1 = '+s1+', k2 = '+s2+', k3 = '+s3 ); except on E:Exception do Writeln(E.Classname, ': ', E.Message); end; finally free; end; end. --------------------------- Debugger Exception Notification --------------------------- Project Project1.exe raised exception class Exception with message ' actual : position = 0, k1 = test1, k2 = test1, k3 = test1 expected: position = 15, k1 = test1, k2 = test2, k3 = test3'. --------------------------- Break Continue Help ---------------------------
QC #: Date Reported: Area:
68234 10/23/2008 Compiler\Delphi\Generics
Description: Steps:
[QC Short Description]
Generics.Collections TDictionary Clear method cause AV

[QC Description]
Add item in TDictionary, and Clear dictionary. Then call Add again, will cause AV.
The Clear implementation have bug.
QC Entry 68234
Compile and run the attached application below.

See the following program output indicating failure.

#1
#2
FAIL - Exception Error
ClassName=EAccessViolation
Message=Access violation at address 0041512C in module 'BTS266114.exe'. Writ
e of address FFFFFFF4

program BTS266114;

{ Generics.Collections TDictionary Clear method cause AV }

{$APPTYPE CONSOLE}

uses
SysUtils,
Generics.Collections;

var
Counter: Integer = 0;

procedure DoIt;
var
dic: TDictionary<integer, integer>;
begin
dic := TDictionary<integer, integer>.Create;
dic.Add(1, 2);

Inc(Counter);
WriteLn('#1');

dic.Clear;

Inc(Counter);
WriteLn('#2');

dic.Add(1, 2);

Inc(Counter);
WriteLn('#3');

if Counter = 3 then
WriteLn('PASS')
else
WriteLn('FAIL Counter=', Counter);
end;

begin
try
DoIt;
except
on E: Exception do
begin
WriteLn('FAIL - Exception Error');
WriteLn(' ClassName=', E.ClassName);
WriteLn(' Message=', E.Message);
end;
end;
end.
QC #: Date Reported: Area:
68247 10/24/2008 VCL\Core VCL Classes\TForm
Description: Steps:
[QC Short Description]
TForm.TransparencyColorValue property does not work for system colors

[QC Description]
TForm is not using ColorToRGB() when calling SetLayeredWindowAttributes() to translate its TransparentColorValue property to an actual RGB value.

SetLayeredWindowAttributes() expects a COLORREF, but clBtnFace and other system-defined TColor values are not valid COLORREF valies, so they will not not appear transparent if passed as-is. Only actual RGB values work correctly. ColorToRGB() converts any TColor value to a valid COLORREF. Other areas of the VCL do use ColorToRGB() when passing TColor values to API functions, so TForm should do the same.

This bug has existed since D6 when the TransparentColorValue property was first introduced.
QC Entry 68247
Create a TForm Set its Color property to clBtnFace Set its TransparentColor property to True Set its TransparentColorValue property to clBtnFace Show the TForm expected: The TForm to be transparent actual: The TForm is not transparent Now change the Color and TransparentColorValue properties to an actual color, like clFuschia. The TForm becomes transparent as expected.
QC #: Date Reported: Area:
68456 10/31/2008 Compiler\Delphi
Description: Steps:
[QC Short Description]
Encounter Internal Error 2084 URW926 for D2007

[QC Description]
Add a unit in your project, and run the following code:


unit MyUnit;

interface

implementation

var A: TBytes;

initialization
A := TBytes.Create(1, 2, 3);
finalization
end.

Compile and you will encounter Internal Error 2084 URW926.
QC Entry 68456
Compile the attached application below with the following command line.

dcc32 -b qc68456.dpr

Fatal: F2084 Internal Error: URW1135

program QC68456;
{ Encounter Internal Error 2084 URW926 for D2007
}

{$APPTYPE CONSOLE}

uses
uQC68456;

begin
WriteLn('PASS'); // PASS on compile //
end.


unit uQC68456;

interface

implementation

uses
SysUtils;

var A: TBytes;

initialization
A := TBytes.Create(1, 2, 3);
finalization
end.
QC #: Date Reported: Area:
68473 10/31/2008 IDE\Project Management
Description: Steps:
[QC Short Description]
AV on IDE startup when default project options contains a reference to a named option set.

[QC Description]
AV on IDE startup when default project options contains a reference to a named option set.

--- Original Automated Report Follows ---

Access violation at address 21560F69 in module 'delphicoreide120.bpl'. Read of address 00000000.

I have installed ReportBuilder 11 and MyDac 570. I made one build options file and deleted some runtime libraries from Windows System related to ReportBuilder.
QC Entry 68473
New VCL Forms application
Project | Configuration Manager
Select the project, right click, and choose "new OptionSet..."
Name and save it
Close Configuration Manager
Project | Options
Click "default" radio button
Click OK
Restart IDE
QC #: Date Reported: Area:
68492 11/1/2008 Database\ADO
Description: Steps:
[QC Short Description]
Assign TParam to TParameter

[QC Description]
Exception occurs if TParam (DataType = ftInteger and Value = 1) assign to TParameter.
Error Message: "Arguments are the wrong type, are out of accetable range, or are in conflict with one another".

This error occurs in TDataSetProvider and i can't migrate our project from D2007 to D2009.
We have multitier application with TClientDataSet -> TRemoteDataModule -> TDataSetProvider -> TADOQuery.

TClientDataSet doesn't open if CommandText has params like as 'EXEC spProcedure :PARAM' and param's DataType is ftInteger and Value is 1)

I have developed simple example project.
QC Entry 68492
TDBXWeaverBugsSuite.Native.DB.Test.exe connection=mssqlconnection -s:TestRaid_266288

==or=

procedure TForm1.Button1Click(Sender: TObject);
var
c1: TParams;
c2: TParameters;

p1: TParam;
p2: TParameter;
begin
c1 := TParams.Create(TParam);
try
p1 := c1.CreateParam(ftInteger, 'TEST', ptInput);
p1.Value := 1;

c2 := TParameters.Create(ADOCommand1, TParameter);
try
p2 := TParameter.Create(c2);
p2.Assign(p1); // Exception!!!!
finally
c2.Free;
end;
finally
c1.Free;
end;
end;
QC #: Date Reported: Area:
68526 11/3/2008 Compiler\Delphi\Anonymous Methods
Description: Steps:
REGRESSION FROM D2009 RTM

[QC Short Description]
F2084 AV06FD5171 on function/reference parameters with SP1

[QC Description]
After installing D2009 SP1, the following code triggers a

[DCC Erreur fatale] Unit5.pas(47): F2084 Erreur interne : AV06FD5171-R00000000-0

in the CompilerBug function (it compile without errors or warnings pre-SP1).
QC Entry 68526

(JJS: See comments from Uwe Schuster on the ambiguouity of the original test case.)

(JJS: See 266296 for a similar issue involving overloads)
Compile the attached application below.

See the following compile-time error indicating failure.

Fatal: F2084 Internal Error: AV0042F851-R00000000-0


program BTS266295;

{$APPTYPE CONSOLE}

uses
SysUtils;

type
TStringFunction = function (const str : String) : String;
TAnonymousStringFunction = reference to function (const str : String) : String;

procedure Test(func : TStringFunction); overload;
begin
end;

procedure Test(func : TAnonymousStringFunction); overload;
begin
end;

procedure CompilerBug;
begin
Test(SysUtils.Trim);
end;

begin
WriteLn('PASS'); // PASS on compile //
end.
QC #: Date Reported: Area:
68527 11/3/2008 Compiler\Delphi\Generics
Description: Steps:
[QC Short Description]
Internal error URW1135 with generic type ARRAY OF T when including remote debug info.

[QC Description]
A generic type defined as ARRAY OF T seems to work only in the same unit and result in Internal Error URW1135 if used in another unit.

(Note that changing the generic type to be a record or a class will make the code compile as expected.)
QC Entry 68527
Compile the attached application below with the following command-line

dcc32 -VR BTS266313

See the following error at compile-time indicating failure.

Fatal: F2084 Internal Error: URW1135

program BTS266313;

{$APPTYPE CONSOLE}

uses
uBTS266313;

procedure test;
var
larray : tdynarray<integer>;
begin
TMyClass<integer>.get_urw1135(larray);
end;


begin
WriteLn('PASS');
end.


unit uBTS266313;

interface

type
tdynarray<T> = array of T; // Will work if replaced by a record or a class

TMyClass<T> = class
public
class procedure get_urw1135(aarray : tdynarray<T>);
end;

implementation

class procedure TMyClass<T>.get_urw1135(aarray: tdynarray<T>);
begin
end;

end.
QC #: Date Reported: Area:
68578 11/4/2008 VCL\Registry / INI Objects
Description: Steps:
[QC Short Description]
TRegistry.ReadString returns invalid result for data that is not null-terminated (Unicode issue)

[QC Description]
Registry.ReadString returns invalid result for data that is not null-terminated. It seems like the function works OK but actually it returns longer string because string length in bytes is treated as length in characters, so result is double length.

QC Entry 68578
Here is how the ReadString looks in D2009 SP1. function TRegistry.ReadString(const Name: string): string; var Len: Integer; RegData: TRegDataType; begin Len := GetDataSize(Name); if Len > 0 then begin SetString(Result, nil, Len); GetData(Name, PChar(Result), Len, RegData); if (RegData = rdString) or (RegData = rdExpandString) then SetLength(Result, StrLen(PChar(Result))) else ReadError(Name); end else Result := ''; end; Note that GetDataSize returns data size in BYTES and that is directly passed to SetString(Result, nil, Len); but SetLength expects length in CHARS so here we create invalid result string (double-long). Typically the error is not visible in result string because Result is typecasted to PChar and that will truncate the Result to proper length. However, if original registry value is not null-terminated that typecasting does not work and wrong (longer) string is returned. That string includes random garbage at the end. This code allows one to create a new string-type registry value that is not null-terminated and read it back to demostrate the issue. While most string values in the registry are null-terminated there are some that are not. procedure TForm1.FormCreate(Sender: TObject); var hRegKey: HKey; begin // Create string type (REG_SZ) value that is not null-terminated if RegOpenKeyEx(HKEY_CURRENT_USER, 'Software', 0, KEY_SET_VALUE, hRegKey) = ERROR_SUCCESS then begin // We only write 3 first chars ABC (6 bytes) so we get non null-terminated registry value RegSetValueEx(hRegKey, 'Test', 0, REG_SZ, PChar('ABCDEFG'), 3 * SizeOf(Char)); RegCloseKey(hRegKey); end; end; procedure TForm1.Button1Click(Sender: TObject); var Registry: TRegistry; begin Registry := TRegistry.Create; if Registry.OpenKeyReadOnly('Software') then ShowMessage('We wrote "ABC" and we read "' + Registry.ReadString('Test') + '"'); Registry.Free end;
QC #: Date Reported: Area:
68616 11/5/2008 Database\ADO
Description: Steps:
[QC Short Description]
TAdoStoredProc returns parameter's value without decimal places

[QC Description]
TAdoStoredProc invokes simple stored proc in MsSqlServer which returns a decimal value
(ex. 150.55)

In D2009 TAdoStoredProc returns 15055 instead of 150.55.

In D2007 TAdoStoredProc returns correct value (ex. 150.55)

QC Entry 68616


Note from Tomohiro Takahashi
<<<<<<<<<<
Please see comment and workaround at QC.
If a instance of TAdoStoredProc is created at Design Time, we get correct value.
>>>>>>>>>>
TDBXWeaverBugsSuite.Native.DB.Test.exe connection=mssqlconnection -s:TestRaid_266369

1. create a simple stored proc in mssqlserver which returs a numeric value

create procedure [dbo].[test] (@t1 numeric(12,2), @t2 numeric(12,2) output) as
begin
set @t2 = @t1 + 0.55;
end;

2. Create a simple form with two TEdit and one TButton object

3. Attach this code in Tbutton.OnClick event

procedure TForm1.Button1Click(Sender: TObject);
var
SP: TAdoStoredProc;
begin
SP := TAdoStoredProc.Create(Self);
SP.Connection := AdoConnection1;
SP.ProcedureName := 'Test';
SP.Parameters.Refresh;


SP.Parameters.ParamByName('@t1').Value := StrToFloat(Edit1.Text) ;
SP.Parameters.ParamByName('@t2').Value := null;


SP.ExecProc;
Edit2.Text := SP.Parameters.ParamByName('@t2').Value;
SP.Free;
end;

4. run the project .

Enter value in Edit1. (ex. 150)
Press the button.
Edit2 shows 15055 instead of 150.55 !
QC #: Date Reported: Area:
68647 11/6/2008 VCL
Description: Steps:
[QC Short Description]
VCL Source BUG

QC Entry 68647
source\Win32\vcl\Forms.pas function GetNonToolWindowPopupParent(WndParent: HWND): HWND; begin Result := GetParent(WndParent); while (Result <> 0) and (GetWindowLong(Result, GWL_EXSTYLE) and WS_EX_TOOLWINDOW = WS_EX_TOOLWINDOW) do Result := GetParent(WndParent); //////<========== Maybe death cycle It should be " Result := GetParent(Result);"
QC #: Date Reported: Area:
68685 11/7/2008 Database\dbExpressCore
Description: Steps:
[QC Short Description]
TDBXDriverRegistry.UnregisterDriverClass is malfunction

[QC Description]
A method "TDBXDriverRegistry.UnregisterDriverClass" in unit DBXCommon.pas isn't programming correctly:

class procedure TDBXDriverRegistry.UnregisterDriverClass(DriverName: String);
var
Index: Integer;
begin
if DBXDriverRegistry.FDriverClasses.Find(DriverName, Index) then
begin
DBXDriverRegistry.FDriverClasses.Delete(Index);
end;
end;

FDriverClasses.Find will only function well if the string list is sorted. However, FDriverClasses never get sorted.

QC Entry 68685
TDBXTiburonBugsSuite.Native.DB.Test.exe connection=ibconnection -s:TestRaid_267173

==or==

Run the following code to show the error:

var S: TStringList;
begin
// Using memory connection factory
TDBXConnectionFactory.SetConnectionFactory(TDBXMemoryConnectionFactory.Create);

// Register driver classes
TDBXDriverRegistry.RegisterDriverClass('C', TDBXDynalinkDriverNative);
TDBXDriverRegistry.RegisterDriverClass('B', TDBXDynalinkDriverNative);
TDBXDriverRegistry.RegisterDriverClass('A', TDBXDynalinkDriverNative);

// Display Registered Classes
S := TStringList.Create;
try
TDBXConnectionFactory.GetConnectionFactory.GetRegisteredDriverNames(S);
ShowMessage(S.Text);
finally
S.Free;
end;

// Unregister driver classes
TDBXDriverRegistry.UnregisterDriverClass('C');
TDBXDriverRegistry.UnregisterDriverClass('B');
TDBXDriverRegistry.UnregisterDriverClass('A');

// Display Registered Classes again (expected empty)
S := TStringList.Create;
try
TDBXConnectionFactory.GetConnectionFactory.GetRegisteredDriverNames(S);
ShowMessage(S.Text);
finally
S.Free;
end;
end;

The example purposely register the driver name in unsorted manner to show the problem. If the name are
registered in order (e.g.: A, B, C), it works fine.
QC #: Date Reported: Area:
68752 11/10/2008 Database\TParams
Description: Steps:
[QC Short Description]
TParam.GetDataSize return incorrect value for Blob data type

[QC Description]
If we have a TParam object (Q) of ftBlob and we assign a string to it:

Q.Value := 'TEST';

Invoke Q.GetDataSize will return 4. But if invoke TParams.AsBytes it would return a TBytes of length 8.

This create a problem in procedure SetQueryProcParams of SqlExpr.pas:

procedure SetQueryProcParams(const Sender: TSQLConnection;
const Command: TDBXCommand; const Params: TParams; ProcParams: TList = nil);
begin
...
ftBlob, ftGraphic..ftTypedBinary,ftOraBlob,ftOraClob:
begin
Buffer := TDBByteBuffer.Create(Param.GetDataSize);
Buffer.Append(Param.AsBytes);
ExtractedBytes := Buffer.GetBytes;
Value.SetDynamicBytes(0, ExtractedBytes, 0, Length(ExtractedBytes));
end;
...
end;

Invoke "Buffer.Append(Param.AsBytes)" will always raise ERangeError exception with message 'CheckSpace'.

The reason is simple. Buffer is allocated 4 bytes of space but we later append 8 bytes of data to it and thus the ERangeError was raised.

I am not sure if this is a bug or it is by design. Should we let the program decide the encoding of string data store into a blob field? If we let the program decide, the blob field data may not accessible by legacy program that always treat the blob field string data as ANSI encoding.
QC Entry 68752
TDBXWeaverBugsSuite.Native.DB.Test.exe connection=mssqlconnection -s:TestRaid_266480

Run the following in Delphi 2009:

var P: TParams;
Q: TParam;
i, j: integer;
begin
P := TParams.Create;
try
Q := P.CreateParam(ftBlob, 'Blob', ptInput);
Q.Value := 'TEST';

i := Q.GetDataSize;
j := Length(Q.AsBytes);
finally
P.Free;
end;
end;

variable i return 4
variable j return 8
QC #: Date Reported: Area:
68753 11/10/2008 RTL\Delphi\Other RTL
Description: Steps:
[QC Short Description]
ToUpper() and ToLower() methods of TCharacter class alter source string

[QC Description]
The ToUpper() and ToLower() methods of TCharacter incorrectly alter the memory of the source String that is passed to them. This is because they are passing the source String as both the input and output buffers for LCMapString(), rather than allocating a new String buffer for the output instead.
QC Entry 68753
var s: string; begin s := 'tEsT sTrInG'; Writeln(TCharacter.ToUpper(s)); Writeln(TCharacter.ToLower(s)); Writeln(s); end; Expected: TEST STRING test string tEsT sTrInG Actual: TEST STRING test string test string
QC #: Date Reported: Area:
68763 11/10/2008 VCL\Core VCL Classes
Description: Steps:
[QC Short Description]
UTF8String published properties corrupts their text

[QC Description]
Attempting to type any characters outside the active codepage into a UTF8String property in the object inspector corrupts the text, and replaces the characters with question marks.

It appears that the RTL is unable to stream UTF8String published properties to and from form resources.

See attachments in conjunction with "Steps" for an example.
QC Entry 68763
1) Load and install MyPackage.dpk 2) Create a new VCL Win32 application 3) Add a TMyComp to the form 4) Try to enter text *not* in the active codepage (e.g. Chinese) into the MyProp property of the component Expected: The Chinese text is accepted and displays correctly. Actual: The Chinese characters are replaced with question marks.
QC #: Date Reported: Area:
68766 11/10/2008 VCL\Core VCL Classes\TWinControl
Description: Steps:
[QC Short Description]
SetImeCompositionWindow doesnt work on Vista

[QC Description]
SetImeCompositionWindow doesnt support Font effect.
it seems that Imm32SetCompositionFont has bug.
if it change to ImmSetCompositionFont(w), it works well.
QC Entry 68766
uses imm procedure TForm1.FormCreate(Sender: TObject); begin SetImeMode(Handle,imHira); SetImeCompositionWindow(Font,0,0); //type key with IME(japanese) end; the newest sample can download from this link http://hp.vector.co.jp/authors/VA015390/delphi/zip/imm32bug.zip
QC #: Date Reported: Area:
68881 11/13/2008 Compiler\Delphi\Anonymous Methods
Description: Steps:
[QC Short Description]
Incorrect codegen for anonymous method / generics

[QC Description]
The following code demonstrates an incorrect codegen on the "FDataObject.FieldSet:=True;" assignment, which written over the "Field" field as if its length was 1 byte (it's a 4 bytes integer).
The issue seems to happen between generics and anonymous functions, if the assignment code is copied to the StoreData body, its codegen will be correct, only the version in the anonymous method body seems affected.
QC Entry 68881
Use the following code. Displayed value will be 466 instead of 1234. Breakpoint on the "FDataObject.FieldSet:=True;" line and go to asm view, the offset is incorrect. type TAnonymousMethod = reference to procedure; TAnonymousFunction<T> = reference to function : T; TDataObject<T> = class Field : T; FieldSet : Boolean; end; TSomeObject<T> = class FDataObject : TDataObject<T>; function StoreData(func : TAnonymousFunction<T>) : TAnonymousMethod; end; function TSomeObject<T>.StoreData(func : TAnonymousFunction<T>) : TAnonymousMethod; begin FDataObject:=TDataObject<T>.Create; result:=procedure begin FDataObject.Field:=func(); FDataObject.FieldSet:=True; // comment out to get 1234 end; end; procedure TForm1.Button2Click(Sender: TObject); var someObject : TSomeObject<Integer>; myAnonMethod : TAnonymousMethod; begin someObject:=TSomeObject<Integer>.Create; myAnonMethod:=someObject.StoreData(function : Integer begin Result:=1234; end); myAnonMethod(); // execute it Caption:=IntToStr(someObject.FDataObject.Field); // shows 466 someObject.Free; end;
QC #: Date Reported: Area:
68884 11/13/2008 Compiler\Delphi\Generics
Description: Steps:
[QC Short Description]
Incorrect errors with higher-order function declarations involving generics.

[QC Description]
[DCC Error] FunctionalLib.pas(70): E2037 Declaration of 'Curry<A,B,R>'
differs from previous declaration
QC Entry 68884
Compile the attached application involving the declarations seen below.

See the following unexpected error.
Error: E2037 Declaration of 'Curry<A,B,R>' differs from previous declaration

Edit the comments to replace the method header on line #2 with the one on line #3 and recompile.

See that compilation succeeds when parameter list and result type are omitted.

Enable the body of the method beginning on the line marked #4 & recompile.
See the following unexpected error.

Error: E2086 Type 'TFunctional.Curry$ActRec<A,B,R>' is not yet completely defined

Edit the comments again to disable the method body on line #4 and enable the one on line #5 and recompile.

See that calling PartialApply succeeds where the same code fails in place.

Also notice that the very similar declaration Curry2 compiles without error.


type
TFuncFunc<A,B,R> = reference to function(Arg1:A) : TFunc<B, R>;

TFunctional = class
public
class function PartialApply<A, B, R>(AFunc: TFunc<A, B, R>; AArgA: A): TFunc<B, R>;
class function Curry<A, B, R>(AFunc: TFunc<A, B, R>): TFunc<A, TFunc<B, R>>; //#1//
class function Curry2<A, B, R>(AFunc: TFunc<A, B, R>): TFuncFunc<A,B,R>;

end;

class function TFunctional.PartialApply<A, B, R>(AFunc: TFunc<A, B, R>;
AArgA: A): TFunc<B, R>;
begin
Result := function(AArgB: B): R
begin
Result := AFunc(AArgA, AArgB);
end;
end;

(***) //#2//
class function TFunctional.Curry<A, B, R>(AFunc: TFunc<A, B, R>): TFunc<A, TFunc<B, R>>;
(*** ) //#3//
class function TFunctional.Curry<A, B, R>;
(***)
begin
(*** ) //#4//
Result := function(AArgA: A): TFunc<B, R>
begin
Result := function(AArgB: B): R
begin
Result := AFunc(AArgA, AArgB);
end;
end;
(*** ) //#5//
Result := function(AArgA: A): TFunc<B, R>
begin
Result := PartialApply<A, B, R>(AFunc, AArgA);
end;
(***)
end;
QC #: Date Reported: Area:
68885 11/13/2008 Compiler\Delphi\Generics
Description: Steps:
[QC Short Description]
Run-time AV error using generics

[QC Description]
See steps
QC Entry 68885
Compile and run the attached application.

See the following error at run-time indicating failure.

FAIL - Exception= EAccessViolation/Access violation at address 00406B29 in module 'BTS266636.exe'. Read of address 00000005

Notice, if execution stops at a breakpoint set on the line marked #1 and you trace to the next source line, the execution point will go to TFunctional.Memoize2 and when the line marked #2 is executed, an AV error occur.

procedure DoIt;
var
MemoizedSlowSub: TFunc<Integer, Integer, Integer>;
ColdResult: Integer;
begin
MemoizedSlowSub := TFunctionalExamples.MemoizedSlowSubtract();
ColdResult := MemoizedSlowSub(5, 3); //#1//
WriteLn('PASS'); //PASS if no exception error //
end;

class function TFunctional.Memoize2<A, B, R>(AFunc: TFunc<A, B, R>): TFunc<A, B, R>;
var
MFunc: TFunc<A, TFunc<B, R>>;
begin
MFunc := Memoize<A, TFunc<B, R>>(MemoizeCurry<A, B, R>(AFunc));
Result := function(AArgA: A; AArgB: B): R
var
CurriedRes: TFunc<B, R>;
begin
CurriedRes := MFunc(AArgA); //#2//
Result := CurriedRes(AArgB);
end;
end;

QC #: Date Reported: Area:
69002 11/17/2008 VCL\Docking
Description: Steps:
[QC Short Description]
TDocktree.SaveToStream saves wrong FRelativeSizes

[QC Description]
While using the standard dockmanagers (TDockTree) SaveToStream procedure, the second stream information (the one after the version used) is FRelativeSizes, which is written to the Stream in a wrong manner. After loading of docked windows and thus using a wrong FRelativeSizes value this could result in a screwed docking window layout.

Lines:
14052 procedure TDockTree.SaveToStream(Stream: TStream);

14108 LBytes[0] := Byte(FRelativeSizes);
14109 Stream.Write(LBytes, 1);
14110 LBytes[0] := Byte(FTopZone.FOrientation);
14111 Stream.Write(LBytes, 1);

14109 and 14111 is wrong. See Workaround for solution.
QC Entry 69002
Dock some windows, use Dockmanager.SaveToStream and afterwards Dockmanager.LoadfromStream. Depending on the LByte-Pointer Address this could result in a wrong FRelativeSizes value.
QC #: Date Reported: Area:
69007 11/17/2008 VCL\Win 32 Controls\TToolBar
Description: Steps:
[QC Short Description]
Setting Gradientstyle in a RTL form throws exception

[QC Description]
If a form is set to RightToLeft-Reading (e.g. Arabic) and you put a Toolbar with Drawingstyle := dsGradient you'll get an OutofResourceException.

Problem:
While drawing the background the Width of the Toolbar is set to a negative value, resulting in an OutofResourceException in this procedure

function TToolBar.GradientDrawButton
...
FBitmap.SetSize(Width, Height); <- Width is <0 !!!
QC Entry 69007


SB:
All windowed controls have a negative Width if the parent has the WS_EX_LAYOUTRTL style.

The proposed fix is incorrect, needs to be generic in TWinControl
Create a Form, use CreatParams and set it to RTL procedure TForm3.CreateParams(var Params: TCreateParams); begin inherited; Params.ExStyle := Params.ExStyle or WS_EX_LAYOUTRTL or WS_EX_NOINHERITLAYOUT; end; Put on a Toolbar, use Drawinstyle := dsGradient. Run.
QC #: Date Reported: Area:
69028 11/17/2008 Compiler\Delphi\BASM
Description: Steps:
[QC Short Description]
SSE4 Instruction PBLENDW does not Compile

[QC Description]
The PBLENDW instruction is described in

http://download.intel.com/design/processor/manuals/253667.pdf

p 4-72

Opcode
66 0F 3A 0E /r ib
PBLENDW xmm1, xmm2/m128, imm8

Select words from xmm1 and xmm2/m128 from mask specified in imm8 and store the values into xmm1.

This should be valid code

pblendw xmm0, xmm1, 0

but it will not compile

[DCC Error] Unit1.pas(264): E2116 Invalid combination of opcode and operands

This should be invalid code

pblendw xmm0, xmm1, xmm0

but compiles into

Unit1.pas.263: pblendw xmm0, xmm1, xmm0
00466148 660F3A0EC166 pblendw xmm0,xmm1,$66
QC Entry 69028
Compile the attached program below.

See that program unexpectedly compiles successfully despite the incorrect syntax on the line marked #1.

Comment-out the source on line #1 and enable the line marked #2 by removing the comment characters disabling it. Now recompile and see the following unexpected error for what should be correct syntax for PLENDW.

Error: E2116 Invalid combination of opcode and operands


program BTS266771;

{$APPTYPE CONSOLE}

uses
SysUtils;
type
TWord128 = packed record
I1,I2,I3,I4,I5,I6,I7,I8 : SmallInt;
end;

function SSE4_PBLENDW(const Word128a, Word128b : TWord128) : TWord128;
asm
movupd xmm0, [Word128a]
movupd xmm1, [Word128b]
pblendw xmm0, xmm1, xmm0 //#1
//pblendw xmm0, xmm1, 0 //#2
movupd [Result], xmm0
end;


procedure DoIt;
var
Word128a, Word128b, ResWord128 : TWord128;
begin
ResWord128 := SSE4_PBLENDW(Word128a, Word128b);
end;


begin
try
DoIt;
except
on E: Exception do
WriteLn('FAIL - Exception=', E.ClassName, '/', E.Message);
end;
end.
QC #: Date Reported: Area:
69107 11/19/2008 VCL\System Controls\TMediaPlayer
Description: Steps:
[QC Short Description]
Access Violation on Click

[QC Description]
If you hide all buttons in TMediaPlayer the run the application - clicking on the media player's box will rise an access violation
QC Entry 69107
1. Put a TMediaPlayer on your form. 2. Put all VisibleButtons to false 3. Run the application 4. Click on the empty square (which is the media player component without any buttons) -> An access violation will be risen at: Line 559 in MPlayer.pas: BX := (ButtonWidth div 2) - (Bitmap.Width div 2);
QC #: Date Reported: Area:
69116 11/19/2008 ActiveX\Type Library Editor
Description: Steps:
[QC Short Description]
Adding a new ActiveForm to a ActiveX Library adds strange Aliases

[QC Description]
Adding a new ActiveForm to a ActiveX Library adds Alias "PPUserType1" to the Type Library.
It has Type = IFontDisp** and Guid = 0

This also happens when I hit refresh on my existing type library. This is alot more annoying as it never stops adding these Aliases. I just manually removed 50 "PPUserTypeXXX" from my type library.
QC Entry 69116


//regression in behavior
New ActiveX Library New ActiveForm You will see down the bottom of the type library that there is an Alias PPUserType1 and sometimes PPUserType2. Hit refresh you will see PPUserType3.
QC #: Date Reported: Area:
69243 11/24/2008 Compiler\Delphi\Generics
Description: Steps:
[QC Short Description]
Generics & interface in a record incorrect codegen

[QC Description]
The following code bombs because the interface field in the record is nil, whereas it's set just a few lines before.

If instead of generics, the type is hardcoded
(integer), or if another field is added to TMyRecord (any other field), the execution is okay.

Some investigation work by Marc Rohloff and details discussion can be found in
https://forums.codegear.com/thread.jspa?threadID=7410
QC Entry 69243
Compile and run the attached application below.

See the following program output indicating an exception error and failure.

FAIL - Exception = EAccessViolation/Access violation at address 0040BD04 in module 'BTS266928.exe'. Read of address 00000000

Enabling the line marked #1 will permit the program to run as expected.

program BTS266928;

{$APPTYPE CONSOLE}

uses
SysUtils;

type
IMyInterface = interface
procedure Dummy;
end;
TMyClass = class (TInterfacedObject, IMyInterface)
procedure Dummy;
end;

TMyRecord<T> = record
MyIntf : IMyInterface;
//SomeUnusedField : Integer; //#1 uncomment and it will work
class operator Implicit (value : T) : TMyRecord<T>;
end;

procedure TMyClass.Dummy;
begin
end;

class operator TMyRecord<T>.Implicit (value : T) : TMyRecord<T>;
var
newObj : TMyClass;
begin
newObj:=TMyClass.Create;
Result.MyIntf:=newObj;
end;

procedure DoIt;
var
myRec : TMyRecord<Integer>;
begin
myRec:=1;
myRec.MyIntf.D/ummy; // bombs because myRec.MyIntf is nil
WriteLn('PASS');
end;

begin
try
DoIt;
except
on E: Exception do
WriteLn('FAIL - Exception = ', E.ClassName, '/', E.Message);
end;
end.
QC #: Date Reported: Area:
69278 11/24/2008 RTL
Description: Steps:
[QC Short Description]
Function comobj.GetRegStringValue returns incorrectly sized String

[QC Description]
Function GetRegStringValue within comobj.pas calls the windows API RegQueryValueEx which returns a number of bytes not the length of the string. This means that the result needs to be adjusted by the SizeOf(Char).

The workaround shows the mended code.
QC Entry 69278
 
QC #: Date Reported: Area:
69294 11/25/2008 VCL\Win 32 Controls\TProgressBar
Description: Steps:
[QC Short Description]
TProgressBar fails with PBS_MARQUEE and disabled Themes

[QC Description]
The TProgressBar fails with Style pbstMarquee and disabled Themes where it is supported natively.

Verified a manual PBS_MARQUEE to be working with "Classic Theme" in Vista and D2006. Only Manifest and ComCtrls 6 are needed but not the enabled Visual Styles as implemented in VCL.
QC Entry 69294
1) Create a new vcl form project (with manifest) 2) Drop TProgressBar on the form 3) Set style to pbstMarquee Run the application e.g. under Vista with designed themes (Aero). Marquee is working fine. Now set the Vista style to "Classic themes" or click on the executable to disable theming using the Application Compatibility Layer. Expected: Marquee still working Currently: Empty ProgressBar shown
QC #: Date Reported: Area:
69362 11/26/2008 Debugger\Watches
Description: Steps:
[QC Short Description]
List Index out of bounds when closing a project that has watches saved in its .dsk file

[QC Description]
List Index out of bounds when closing a project that has watches saved in its .dsk file

This only happens if you never open the Watch window after reopening the project
QC Entry 69362
Create a new Delphi console project
Make sure Autosave Project Desktop is enabled on Tools | Options | Environment Options
Run | Add watch
Give "foo" for expression
Give "bar" for Group name (this is the important step)
OK
File | Save all and accept defaults
File | Close all
Use the Desktop Layout combo box to reload the Default Layout (so that the Watch window gets hidden)
File | Reopen and select the project you just saved and closed
File | Close all

---------------------------
Error
---------------------------
List index out of bounds (1).
---------------------------
OK Details <<
---------------------------
[40052AB8]{rtl140.bpl } Classes.TStrings.Error (Line 4770, "Classes.pas" + 1) + $1
[40052B1F]{rtl140.bpl } Classes.TStrings.Error (Line 4775, "Classes.pas" + 1) + $14
[40054826]{rtl140.bpl } Classes.TStringList.Delete (Line 5440, "Classes.pas" + 1) + $1D
[00F17E72]{vcl140.bpl } Tabs.TTabList.Delete (Line 567, "Tabs.pas" + 2) + $6
[400548A8]{rtl140.bpl } Classes.TStringList.Delete (Line 5450, "Classes.pas" + 11) + $5
[01996590]{coreide140.bpl} WatchWin.TWatchWindow.ClearList (Line 1253, "..\debugger\WatchWin.pas" + 11) + $14
[0199FF25]{coreide140.bpl} DebugCmds.TDebugCommands.WatchViewClearList (Line 187, "..\debugger\DebugCmds.pas" + 2) + $9
[01918FF0]{coreide140.bpl} DebuggerMgr.TDebuggerMgr.NotifyProjectGroupClosed (Line 1285, "DebuggerMgr.pas" + 3) + $F
[0040E9F9]{bds.exe } AppMain.CanCloseProjectModule (Line 2422, "ui\AppMain.pas" + 1) + $5
[0040F550]{bds.exe } AppMain.TAppBuilder.UpdateCaptionNow (Line 2591, "ui\AppMain.pas" + 100) + $2B6
[4006426D]{rtl140.bpl } Classes.TBasicAction.Execute (Line 12229, "Classes.pas" + 3) + $9
[00EAC13B]{vcl140.bpl } ActnList.TContainedAction.Execute (Line 448, "ActnList.pas" + 8) + $35
[00EAD603]{vcl140.bpl } ActnList.TCustomAction.Execute (Line 1094, "ActnList.pas" + 7) + $C
[4006404D]{rtl140.bpl } Classes.TBasicActionLink.Execute (Line 12158, "Classes.pas" + 2) + $A
[013D9FAF]{vclactnband140.bpl} ActnMenu
QC #: Date Reported: Area:
69409 11/28/2008 Database\Data Access Controls\TDatabase
Description: Steps:
[QC Short Description]
Getting or Setting TDatabase Directory property fails

[QC Description]
There are string handling issues with TDatabase GetDirectory and SetDirectory.

Attempting to read the Directory property returns what appears to be an uninitialized string of characters.

Setting the property to a known path and subsequently reading it back gives the same obscure results.

This worked fine under D2007
QC Entry 69409
Drop a TDatabase, TTable and a TButton on a form Set the TDatabse DatabaseName to 'LocalDB' Set the TDatabase AliasName to a DBDEMOS Set the TTable DatabaseName to 'LocalDB' and set it's TableName to customer.db In the Buttons OnClick event add this code Table1.Open; ShowMessage(Database1.Directory); Run it and click the button. The table is opened but the message dialog (Ctrl C copied to paste here) shows --------------------------- Project1 --------------------------- ??????????????????????????????????????????????????" << note: this was originally chinese, wingdings type characters --------------------------- OK --------------------------- If you also add an AfterConnect event handler on the TDatabase and add the following code Database1.Directory := 'C:\Program Files\Common Files\CodeGear Shared\Data'; You still get a similar result as before when clicking the button So you can't read or write the Directory property. Note: After initial submission of this report, the strange characters (some chinese, wingdings type stuff etc.) changed to all question marks
QC #: Date Reported: Area:
69413 11/28/2008 Database\Data Access Controls\TTable
Description: Steps:
[QC Short Description]
TTable.Exists always returns False

[QC Description]
This is related to QC report number 69409 because the code in TTable.GetFileName relies on the database Directory property which does not contain a valid string.

This worked fine under D2007

See also Raid# 266976, which causes this bug too.

QC Entry 69413
Drop a TDatabase, TTable and a TButton on a form Set the TDatabse DatabaseName to 'LocalDB' Set the TDatabase AliasName to a DBDEMOS Set the TTable DatabaseName to 'LocalDB' and set it's TableName to customer.db In the Buttons OnClick event add this code ShowMessage('Table1.Exists = ' + BoolToStr(Table1.Exists, True)); Run it and click the button. It always results in Table1.Exists = False A lot of conditional opening of tables is based on this and it's a complete showstopper for me.
QC #: Date Reported: Area:
69427 11/28/2008 RTL
Description: Steps:
[QC Short Description]
Generics.collection TDictionary iterators may return garbage data

[QC Description]
TDictionary<TKey,TValue>.TPairEnumerator.MoveNext
TDictionary<TKey,TValue>.TKeyEnumerator.MoveNext:
TDictionary<TKey,TValue>.TValueEnumerator.MoveNext:

all contain the line

while FIndex < Length(FDictionary.FItems) do

this should be

while FIndex < Length(FDictionary.FItems) -1 do

since FIndex is incremented after the check and the last item has index = length( FDictionary.FItems )-1

This can lead to the enumerators returning non-existing data
QC Entry 69427
Steps added by Uwe Schuster: - save the attached project file DictionaryRangeCheckError.dpr - copy source\Win32\rtl\common\Generics.Collections.pas into the directory where you've save the project - modify line 11 in Generics.Collections.pas from {$R-,T-,X+,H+,B-} to {$T-,X+,H+,B-} - dcc32 -B -$R+ DictionaryRangeCheckError.dpr - execute DictionaryRangeCheckError.exe expected: 3 2 1 PASS actual: 3 2 1 FAIL (Reason = ERangeError)
QC #: Date Reported: Area:
69432 11/29/2008 Database\Data Access Controls\TTable
Description: Steps:
[QC Short Description]
Error opening table when field has a DefaultExpression

[QC Description]
There seems to be an issue with the GetDefaultExpression function in the TBDEDataSet.ConstraintCallBack function in the DBTables unit.

I was getting the following error when opening the TTable which has persistent fields and two of them (TBooleanFields) have a DefaultExpression set to FALSE.

"Preparation of field default failed.
Token not found.
Token: €€€€€€Ì << these look like euro symbols and accented characters
Line Number: 1"

I traced into the above function and found that after calling this line:

StrCopy(ADataSources.szSQLExprImport, GetPAnsiChar(Field.DefaultExpression));

The value in ADataSources.szSQLExprImport is all corrupt characters.

If I remove the DefaultExpressions from the two fields, the table opens without error.

I cannot replicate this in a simple test project but within a large application with several tables, queries, datamodules, etc. the error happens every time. The strange characters can vary each time though.

This worked fine under D2007


QC Entry 69432
I tried the following The GetPAnsiChar is as follows function GetPAnsiChar(const S: string): PAnsiChar; begin if S <> '' then Result := PAnsiChar(AnsiString(S)) else Result := ''; end; But if I replace the original line with this: StrCopy(ADataSources.szSQLExprImport, PAnsiChar(AnsiString(Field.DefaultExpression))); Then the error doesn't occur any more and ADataSources.szSQLExprImport always contains a valid value (FALSE in my case) Now, this looks to me to be doing exactly the same thing but I think something is going wrong when calling GetPAnsiChar instead which causes it to return the corrupt string. I've spent ages trying to replicate it outside the main application but cannot do so. It only raises the error when I run the big application with lots of tables/queries open If pushed I could probably send you a screen vid of the situation happening in the debugger.
QC #: Date Reported: Area:
69456 11/30/2008 IDE\Code Editor
Description: Steps:
[QC Short Description]
IDE Deadlock when updating the the editor views

[QC Description]
The TEditorBuffer.UpdateViews method is called from the background thread but accesses the editor's canvas. The dead lock occurs because the main thread is blocked by the lock that the background parser owns.
QC Entry 69456
Thread stacktrace (reconstructed): TGraphicObject.Lock <= Deadlock TFont.SetStyle EditorBuffer.TEditBuffer.UpdateViews :20835992 coreide120.@Editorbuffer@TEditBuffer@DoCheckSetBreakpointables$qqro + 0x1a :20836413 coreide120.@Editorbuffer@TEditBuffer@ProjectStateChanged$qqrp14System@TObject + 0x2b :20b86e94 TEvent.Send + $28 :2077801a coreide120.@Projectmodule@TBaseProject@SetProjectState$qqr50System@%Set$t22Codemgr@TProjectStates$iuc$0$iuc$6% + 0x32 :207790a7 coreide120.@Projectmodule@TCustomCodeIProject@SetProjectState$qqr50System@%Set$t22Codemgr@TProjectStates$iuc$0$iuc$6% + 0x13 :2161dfa2 delphicoreide120.SetKibitzedSinceCompiled + 0xaa .NET Code
QC #: Date Reported: Area:
69461 11/30/2008 Compiler\Delphi\Generics
Description: Steps:
[QC Short Description]
Generic type incompatible with itself across units.

[QC Description]
've got a TDictionary that stores a bunch of objects indexed by name, and I'd like to be able to examine all of the objects. So I tried this:

var enumerator: TMyObject;
begin
for enumerator in myDictionary do

But that wouldn't compile. "Incompatible types: 'TMyObject' and 'TPair'

So I tried it a bit differently:

var enumerator: TPair<string, TMyObject>;

That didn't compile either. This error message is even stranger: Incompatible types: 'TPair<string, TMyObject>' and 'TPair<string, MyUnit.TMyObject>'.

It gets worse. I tried to create a wrapper class around the dictionary that would handle the data retrieval internally. But now I can't call any of its methods. Any method call, even ones with no parameters, gets this:

[DCC Error] E2010 Incompatible types: 'TMyDictionary<MyUnit.TMyDictionary<TKey,TIndex,TValue>.TKey,MyUnit.TMyDictionary<TKey,TIndex,TValue>.TIndex,MyUnit.TMyDictionary<TKey,TIndex,TValue>.TValue>' and 'TMyDictionary<System.string,System.string,turbu_characters.TMyObject>'

This is a complete show-stopper. Anyone know how to fix this?
QC Entry 69461
Compile the attached application below.

See the following compile-time error indicating failure.

BTS266981.dpr(19) Error: E2010 Incompatible types: 'TPair<System.string,uBTS266981.TMyObject>' and 'TPair<System.string,TMyObject>'

unit uBTS266981;

interface

uses
Generics.Collections;

type

TMyObject = class(TObject)
private
FIntValue: Integer;
public
constructor Create(AValue: Integer);
property IntValue: Integer read FIntValue;
end;

TMyDictionary = TDictionary<string, TMyObject>;

TMyContainer = class(TObject)
private
FDictionary: TMyDictionary;
public
constructor Create;
property Dictionary: TMyDictionary read FDictionary;
end;


implementation

constructor TMyContainer.Create;
begin
inherited Create;
FDictionary := TMyDictionary.Create;
end;

constructor TMyObject.Create(AValue: Integer);
begin
FIntValue := AValue;
end;

end.


program BTS266981;

{$APPTYPE CONSOLE}

uses
SysUtils,
Generics.Collections,
uBTS266981;

var
Pair: TPair<string, TMyObject>;
MyObject: TMyObject;
myContainer: TMyContainer;
begin
myContainer := TMyContainer.Create;
myContainer.Dictionary.Add('One', TMyObject.Create(1));
myContainer.Dictionary.Add('Two', TMyObject.Create(2));
myContainer.Dictionary.Add('Three', TMyObject.Create(3));
for Pair in myContainer.Dictionary do
Writeln('Key=' + Pair.Key + ' IntValue=' + IntToStr(Pair.Value.IntValue));
for MyObject in myContainer.Dictionary.Values do
Writeln('IntValue=' + IntToStr(MyObject.IntValue));
WriteLn('PASS'); // PASS on compile
end.


QC #: Date Reported: Area:
69462 11/30/2008 SOAP\Client Applications
Description: Steps:
[QC Short Description]
Midas raise "variant or safe array is locked" error in demo project

QC Entry 69462
OS : Windows XP SP3 1. Start delphi 2009 IDE (with update1). 2. Open SOAP Datamodule Demo project group, for example : C:\Documents and Settings\All Users\Documents\RAD Studio\6.0\Demos\DelphiWin32\VCLWin32\WebServices\SOAPDataModule\SOAPDataModule.groupproj 3. Build server application (SOAPDMServerWAD.exe) 4. Start "Web App debugger" application from menu (tools->Web App debugger) and change service port to 1024, then start the service. 5. start server Application (SOAPDMServerWAD.exe) from Windows file manager. 6. Build and run client application (SOAPDMClient.exe), click "Connect" button. Delphi IDE debuger will raise a access violation error ( from module midas.dll ) and error message string is "Variant or safe array is locked". Note : I have been tried to use "midaslib" unit in both projects to avoid the discrepancy of midas.dll, but still not work.
QC #: Date Reported: Area:
69468 12/1/2008 RTL\Delphi\Pascal Strings
Description: Steps:
[QC Short Description]
Preserving codepage: either _LStrCatN is wrong, or both _LStrCat and _LStrCat3 are wrong.

[QC Description]
When assigning RawByteString, _LStrCatN does not preserve the CodePage, but _LStrCat and _LStrCat3 do.

See the output of the reproducible steps.
No failures should appear but one does for the line marked #3 using _LStrCatN.

This happens without any compiler warnings on the concatenation lines!

So either _LStrCatN is wrong, or both _LStrCat and _LStrCat3 are wrong.


Note: It does not matter of these variables are of type RawByteString, or UTF8String: the error message stays the same!
QC Entry 69468
Compile and run the attached application below.

See the following output indicating failure.

R_CodePage =65001
FAIL #3 - Expected CP=65001 Actual=1252


program BTS266959;

{$APPTYPE CONSOLE}

uses
SysUtils;

var
Counter: Integer = 0;

var
stringFoo: string = 'stringFoo';
ansiFoo: AnsiString = 'ansiFoo';

const
LF = AnsiChar(#10);
TwoLF = LF + LF;

procedure Test;
var
RawStringFoo: RawByteString;
RawAnsiFoo: RawByteString;
R: RawByteString;
R_LStrCat: RawByteString;
R_LStrCat3: RawByteString;
R_LStrCatN: RawByteString;
R_CodePage: Integer;
R_LStrCat_CodePage: Integer;
R_LStrCat3_CodePage: Integer;
R_LStrCatN_CodePage: Integer;
begin
{ Convert and concatenate using RawByteString types }
R := UTF8Encode(ansiFoo);
R_LStrCat := UTF8Encode(ansiFoo);
R_LStrCat := R_LStrCat + TwoLF; //#1 calls _LStrCat
R_LStrCat3 := R + TwoLF; //#2 calls _LStrCat3
R_LStrCatN := R + LF + LF; //#3 calls _LStrCatN

{ Obtain the code pages }
R_CodePage := StringCodePage(R);
WriteLn('R_CodePage =', R_CodePage);

R_LStrCat_CodePage := StringCodePage(R_LStrCat); {#1}
R_LStrCat3_CodePage := StringCodePage(R_LStrCat3); {#2}
R_LStrCatN_CodePage := StringCodePage(R_LStrCatN); {#3}

if R_CodePage = R_LStrCat_CodePage then
Inc(Counter, 1)
else
WriteLn('FAIL #1 - Expected CP=',R_CodePage, ' Actual=', R_LStrCat_CodePage);

if R_CodePage = R_LStrCat3_CodePage then
Inc(Counter, 1)
else
WriteLn('FAIL #2 - Expected CP=',R_CodePage, ' Actual=', R_LStrCat3_CodePage);

if R_CodePage = R_LStrCatN_CodePage then
Inc(Counter, 1)
else
WriteLn('FAIL #3 - Expected CP=',R_CodePage, ' Actual=', R_LStrCatN_CodePage);

if Counter = 3 then
WriteLn('PASS');
end;

begin
try
Test();
except
on E:Exception do
Writeln('FAIL - Exception=', E.Classname, ': ', E.Message);
end;
end.
QC #: Date Reported: Area:
69533 12/2/2008 VCL\Dialog Controls\TOpenPictureDialog
Description: Steps:
[QC Short Description]
TOpenPictureDialog raises EInvalidGraphic on selecting a LNK file (single click)

[QC Description]
I get a "Debugger Exception Notification" dialog when selecting or highlighting a *.LNK link file in a TOpenPictureDialog dialog. Exception notification message: Project Project1.exe raised exception class EInvalidGraphic with message 'Unknown picture file extension (.lnk)'.

Open dialog options seem to be ignored, such as the ofNoReadOnlyReturn option. Same exception regardless of options.

If I click Continue on the exception notification dialog, my application continues as if nothing had happened. I have to select the LNK file again to reach its target, which happens without any further exceptions.

The preview feature of TOpenPictureDialog may be what causes the exception.
QC Entry 69533

(SB) Note: The exception only occurs when debugging, not at runtime.
Create a new VCL forms project, add a TOpenPictureDialog and a button. Execute the open dialog from the button. Run the application, click the button, use the open dialog to browse to a *.lnk file and single-click that file. You should now get a EInvalidGraphic exception.
QC #: Date Reported: Area:
69563 12/3/2008 Compiler\Delphi\Generics
Description: Steps:
[QC Short Description]
TList<T>.Sort and TArray<T>.Sort raise EArgumentOutOfRangeException on empty list or array

[QC Description]
TArray<T>.Sort (called by TList<T>.Sort) will raise an EArgumentOutOfRangeException when called with an empty array (empty list) instead of just doing nothing (like Classes.TList does).
The problem is in the sequence of tests done by TArray<T>.Sort:
if (Index < Low(Values)) or (Index > High(Values))
or (Index + Count - 1 > High(Values)) or (Count < 0)
or (Index + Count < 0) then
raise EArgumentOutOfRangeException.CreateRes(@sArgumentOutOfRange);
if Count = 0 then
Exit;

If the list is empty then an empty array will by passed as the Values parameter. For an empty array High returns -1, so the first test (Index is 0 in this case) fails on the (Index > High(Values)) clause. The test for Count = 0 should be done before the If test to avoid this problem. In fact the code should test for Count <= 1 and exit if this is true since sorting a 1 element array is a NOP.


QC Entry 69563
Compile and run the attached application below.
See the following program output indicating failure.

FAIL - Exception=EArgumentOutOfRangeException/Argument out of range

program BTS267069;

{$APPTYPE CONSOLE}

uses
SysUtils,
Generics.Collections;

procedure DoIt;
var
l: TList<integer>;
begin
l := TList<integer>.Create;
try
l.Sort;
finally
l.Free;
end;
end;

begin
try
DoIt;
WriteLn('PASS');
except
on E: Exception do
WriteLn('FAIL - Exception=', E.ClassName, '/', E.Message);
end;
end.
QC #: Date Reported: Area:
69583 12/4/2008 Compiler\Delphi\Generics
Description: Steps:
[QC Short Description]
Generics.Collections: TList<T>.Delete crashes for records

(JJS: See also RAID 267603 related to TStack<>)

[QC Description]
If the generic list is used with a record type, it will crash when Delete() is called. A very simple example would be:

type
TSomething = record
Value: Integer;
end;
TSomethingList = class(TList<TSomething>)
end;

procedure RunTest();
var
LList: TSomethingList;
LSomething: TSomething;
begin
LList := TSomethingList.Create();
LList.Add(LSomething);
LList.Delete(0);
LList.Free();
end;

An Access Violation will occur in TList<T>.DoDelete, in line 765, where FItems[Index] := Default(T);

The Default method is either not documented, or documented somewhere I can't find. Either way, the code would work if this call was not there.
QC Entry 69583
Compile and run the attached application below.

See the following program output indicating failure.

FAIL - Exception=EAccessViolation/Access violation at address 00414CAC in module
'BTS267070.exe'. Write of address 00000000

program BTS267070;
{ Generics.Collections: TList<T>.Delete crashes for records }

{$APPTYPE CONSOLE}

uses
Generics.Collections,
SysUtils;

type
TSomething = record
Value: Integer;
end;

TSomethingList = class(TList<TSomething>)
end;

procedure RunTest();
var
LList: TSomethingList;
LSomething: TSomething;
begin
LList := TSomethingList.Create();
try
LList.Add(LSomething);
WriteLn('Added');
LList.Delete(0);
WriteLn('PASS - Deleted');
finally
LList.Free();
end;
end;

begin
try
RunTest();
except
on E: Exception do
WriteLn('FAIL - Exception=', E.ClassName, '/', E.Message);
end;
end.
QC #: Date Reported: Area:
69634 12/5/2008 Database\DataSnap\Server
Description: Steps:
[QC Short Description]
Datasnap error

[QC Description]
I see no attention to this problem since the report of Christopher on sep.

I’m testing D2009 and tried to enhance the Datasnap and thin client solutions video at:
http://dn.codegear.com/article/38587

and the execution stopped with the “unexpected metadata type” error. Digging into the DB & DBXDBReaders units I found some incomplete functions:

Function TDBXDataSetTable.GetColumns sets the valueType var, and sends to ToDataType function in the DBXDBReaders unit. The case/of list there is missing few types options of the TFieldType type, and returns error when encountering these types, for example autoinc, currency etc.
QC Entry 69634
DataSnapAccess.Native.DB.Test.exe connection=asaconnection -s:ComponentDatasetTest
QC #: Date Reported: Area:
69696 12/8/2008 IDE\Search\Find in Files
Description: Steps:
[QC Short Description]
Using Find in Files sometimes generates AV's and List Index errors.

[QC Description]
Find in Files fails after using it a few times and doesn't work again until you restart Delphi.
QC Entry 69696
Use find in files.

Bug logged in response to discussion in thread:

https://forums.codegear.com/thread.jspa?threadID=6208&tstart=0

Stack traces given (attached) and also here:

https://forums.codegear.com/message.jspa?messageID=47888#47888

QC #: Date Reported: Area:
69700 12/8/2008 Database\TField
Description: Steps:
[QC Short Description]
New field types added in Delphi 2009 are not registered. This includes TLongWordField, TShortintField, TByteField, and TExtendedField.

[QC Description]
TByteField, arguably the most useful field for storing enumerated types, is not registered.
QC Entry 69700
Examine DBReg.pas and look for these new field types in the RegisterFields call:

RegisterFields([TStringField, TIntegerField, TSmallintField, TWordField,
TFloatField, TCurrencyField, TBCDField, TFMTBcdField, TBooleanField, TDateField,
TVarBytesField, TBytesField, TTimeField, TDateTimeField, TSQLTimeStampField,
TBlobField, TMemoField, TGraphicField, TAutoIncField, TLargeIntField,
TADTField, TArrayField, TDataSetField, TReferenceField, TAggregateField,
TWideStringField, TVariantField, TGuidField, TInterfaceField, TIDispatchField,
TWideMemoField]);

QC #: Date Reported: Area:
69717 12/8/2008 IDE
Description: Steps:
[QC Short Description]
Tools menu loses sort order

[QC Description]
When you add tools in the Configure Tool window and arrange them in a particular order for convenience they always appear sorted alphabetically when the IDE is restarted.
QC Entry 69717


This is a regression
Tools | Configure Tools
Add
For Title give "abc"
For Program, give "abc"
Click OK
Note that the "abc" tool is at the bottom of the list
Click Close
Look at the Tools menu in the IDE
Note that the "abc" tool is at the bottom of the menu
Shut down and restart the IDE
Look at the Tools menu in the IDE
Note that the "abc" tool is no longer at the bottom of the menu
QC #: Date Reported: Area:
69752 12/9/2008 RTL\Delphi
Description: Steps:
[QC Short Description]
ToUpper and ToLower with NullString

[QC Description]
The new functions ToUpper() and ToLower() (from the Character unit) raise an exception if the input is an empty or null string. A better behavior would be to return an empty string, just the way the older UpperCase() and LowerCase() functions work.
QC Entry 69752
Compile and run the attached application below.

See the following program output indicating failure.

FAIL #1 - ToUpper Exception=EOSError/System Error. Code: 87.
The parameter is incorrect
FAIL #2 - ToLower Exception=EOSError/System Error. Code: 87.
The parameter is incorrect


program BTS267234;

{$APPTYPE CONSOLE}

uses
SysUtils,
Character;

var
Counter: Integer = 0;

procedure DoIt;
begin
try
ToUpper('');
Inc(Counter);
except
on E: Exception do
WriteLn('FAIL #1 - ToUpper Exception=', E.ClassName, '/', E.Message);
end;

try
ToLower('');
Inc(Counter);
except
on E: Exception do
WriteLn('FAIL #2 - ToLower Exception=', E.ClassName, '/', E.Message);
end;

if Counter = 2 then
WriteLn('PASS');
end;

begin
DoIt;
end.
QC #: Date Reported: Area:
69826 12/11/2008 Database\DBExpress
Description: Steps:
[QC Short Description]
AV when Connection Failed using DBX with MySQL5.0.

[QC Description]
Access Violation occurs when Connection Failed using DBX with MySQL5.0.

added by Ssyop
<<<<<<<<<<
AV occurs when 'ServerCharSet' parameter is set to utf8, sjis etc...
If is it blank, AV does not occur.
>>>>>>>>>>
QC Entry 69826
TDBXWeaverBugsSuite.native.db.test.exe connection=mysqlconnection_utf8 -s:oTestRaid_267326

1) Set wrong Params 'HostName' or 'Database' or 'User_Name' or 'Password' on SQLConnection1.
2) SQLConnection1.Connected := True;
3) Error message:

Access violation at address 1000BC6A in module 'libmysql.dll'. Read of address 00000358.
QC #: Date Reported: Area:
69935 12/16/2008 RTL\Delphi\Other RTL
Description: Steps:
[QC Short Description]
Generics.Collections: TArray<T>.BinarySearch fails for empty array

[QC Description]
The BinarySearch implementation contains the same issue as the one described in QC69563: empty list will lead to an EArgumentOutOfRangeError.

Problem is in Generics.Collectsion, where TArray.BinarySearch<T> does this:

if (Index < Low(Values)) or (Index > High(Values))
or (Index + Count - 1 > High(Values)) or (Count < 0)
or (Index + Count < 0) then
raise EArgumentOutOfRangeException.CreateRes(@sArgumentOutOfRange);
if Count = 0 then
begin
FoundIndex := 0;
Exit(False);
end;

instead of this:

if Count = 0 then
begin
FoundIndex := 0; /// one wonders whether for consistency with IndexOf, it shouldn't return -1 instead, even if there is a separate boolean Result
Exit(False);
end;
if (Index < Low(Values)) or (Index > High(Values))
or (Index + Count - 1 > High(Values)) or (Count < 0)
or (Index + Count < 0) then
raise EArgumentOutOfRangeException.CreateRes(@sArgumentOutOfRange);
QC Entry 69935
Compile and run the attached application below.

See the following program output indicating failure.

FAIL - Exception=EArgumentOutOfRangeException/Argument out of range


program BTS267382;

{$APPTYPE CONSOLE}

uses
SysUtils,
Generics.Collections, Generics.Defaults;

procedure DoIt;
var
MyArray: TList<Integer>;
LCompareFunc: TComparison<Integer>;
LOut: Integer;
begin
LCompareFunc := function(const Left, Right: Integer): Integer
begin
if Left < Right then
Result := -1
else if Left = Right then
Result := 0
else
Result := 1;
end;
MyArray := TList<Integer>.Create(
TDelegatedComparer<Integer>.Create(LCompareFunc));
// MyArray.Add(3); //<<< enabling this line will make it work
if MyArray.BinarySearch(2, LOut) then
WriteLn('FAIL LOut=', LOut)
else
Write('PASS');
end;

begin
try
DoIt;
except
on E: Exception do
WriteLn('FAIL - Exception=', E.ClassName, '/', E.Message);
end;
end.
QC #: Date Reported: Area:
69937 12/16/2008 Compiler\Delphi\Anonymous Methods
Description: Steps:
[QC Short Description]
AV for anonymous method, local variable and local procedure

[QC Description]
In the code below (can be executed anywhere as long as you have Classes and Windows in the uses), the call to the local procedure ResetFlags fails with an AV if a local procedure is present (not called). Stepping in the debugger and trying to evaluate LInnerExecuted inside ResetFlags gives "Inaccessible value".

The problem disappears if the anonymous method is commented-out.

procedure Test3;
var
LInnerExecuted: Boolean;
LList: TList;

procedure ResetFlags();
begin
LList.Add(@LInnerExecuted); // AV if the anon method is present
end;
var
LProcInner: TProcReference;
begin
LList := TList.Create();
LList.Add(@LInnerExecuted);
ResetFlags();

// Outcomment the anonymous method to make the crash disappear.
LProcInner := procedure()
begin
LList.Add(@LInnerExecuted);
end;

LList.Free();
end;


May be related with QC68881.
QC Entry 69937
Compile and run the attached application below.

See the following output at run-time indicating failure.

program BTS267384;

{$APPTYPE CONSOLE}

uses
SysUtils,
Classes;

type
TProcReference = reference to procedure;

procedure Test3;
var
LInnerExecuted: Boolean;
LList: TList;

procedure ResetFlags();
begin
LList.Add(@LInnerExecuted); // AV if the anon method is present
end;
var
LProcInner: TProcReference;
begin
LList := TList.Create();
LList.Add(@LInnerExecuted);
ResetFlags();

// Comment-out the anonymous method to make the crash disappear.
LProcInner := procedure()
begin
LList.Add(@LInnerExecuted);
end;

LList.Free();
end;

begin
try
Test3;
WriteLn('PASS');
except
on E: Exception do
WriteLn('FAIL - Exception=', E.ClassName, '/', E.Message);
end;
end.
QC #: Date Reported: Area:
70019 12/18/2008 RTL\Delphi
Description: Steps:
[QC Short Description]
On Japanese OS, EraNames array for Japanese locale are corrupted.

[QC Description]
On Japanese OS, EraNames array for Japanese locale are corrupted.

Please see Steps and screenshot.
QC Entry 70019
1. launch Delphi 2009 on Japanese OS 2. create VCL form application 3. add ComboBox and Button 4. add OnCLick event handler for the button as below -------- procedure TForm1.Button1Click(Sender: TObject); begin ComboBox1.Items.Add(EraNames[1]); ComboBox1.Items.Add(EraNames[2]); ComboBox1.Items.Add(EraNames[3]); ComboBox1.Items.Add(EraNames[4]); end; -------- 5. Era names for Japanese locale are corrupted... Please see attached screenshot.
QC #: Date Reported: Area:
70022 12/19/2008 RTL\Delphi\ConvUtils
Description: Steps:
[QC Short Description]
System.Val (floating point version) incorrectly sets the code parameter to 0 when the supplied string is empty

[QC Description]
The method System.Val should set the Code output parameter to 1 if the supplied string is empty.

However since Unicode was introduced (Delphi 2009) the floating point version of Val now sets the code parameter to 0 - implying that the string is a valid number, which it is not.

I've marked this type 'B' because it has caused us dozens of bugs, including databases returning invalid reports because the user input was misinterpreted.

I believe that the bug is in _ValExt in System.pas line 9252 (just after @@Empty label).

INC ESI

should be replaced by:

{$IFNDEF UNICODE}
INC ESI
{$ELSE}
ADD ESI, 2
{$ENDIF}
QC Entry 70022
This function should return 1 but instead returns 0: function ValBlankStringBug:Integer; var N:Double; ValCode:Integer; begin Val('',N,ValCode); Result:=ValCode; end;
QC #: Date Reported: Area:
70188 12/30/2008 VCL\Core VCL Classes\Streaming
Description: Steps:
[QC Short Description]
TStreamReader cannot read unicode text files

[QC Description]
TStreamReader cannot be used to read a Unicode Textfile line by
line. It's definitely going to challenge your skills of Chinese unless
the file is very small.

Let's say I have a TextFile with a Unicode BOM and content similar to
this:
Test Test Test Test Test Test Test Test Test Test Test Test Test Test
Test Test Test Test Test Test Test Test Test Test Test Test Test Test
Test Test Test Test Test Test Test Test Test Test Test Test Test Test
[...]

Then TStreamReader reads something like this:
Test Test Test Test Test Test Test Test Test Test Test Test Test Test
Test Test Test Test Test Test Test Test Test Test Test Test Test Test
[...]
Te? ???? ???? ???? ???
?? ???? ???? ???? ????
??? ???? ???? ???? ????
???? ???? ???? ???? ???
???? ???? ???? ????
??? ???? ???? ???? ??

You may also get a "List index out of bounds (1023)" exception.

Output of the demo program:

PASS TMBCSEncoding MyString
PASS TUTF8Encoding MyString
PASS TUTF7Encoding MyString
FAIL - Exception=ERangeError/List index out of bounds (1023)
FAIL - Exception=ERangeError/List index out of bounds (1023)
PASS TMBCSEncoding MyString2
FAIL TUTF8Encoding MyString2
FAIL TUTF7Encoding MyString2
FAIL TUnicodeEncoding MyString2
FAIL TBigEndianUnicodeEncoding MyString2
QC Entry 70188
program Bug; {$APPTYPE CONSOLE} uses SysUtils, Classes, StrUtils; var I, J: Integer; SL: TStringList; MS: TMemoryStream; SR: TStreamReader; S, T: string; Encoding: TEncoding; Pass: Boolean; const MyString = 'Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test '; MyString2 = #955#955#955#955#955#955#955#955#955#955'Test'#228#228#228#228#228#955#955#955#955#955#955#955#955#955#955#968#968#968#968#968; begin for J := 0 to 9 do begin try case J mod 5 of 0: Encoding := TEncoding.Default; 1: Encoding := TEncoding.UTF8; 2: Encoding := TEncoding.UTF7; 3: Encoding := TEncoding.Unicode; 4: Encoding := TEncoding.BigEndianUnicode; else raise Exception.Create('Bug in Testprogram'); end; if J <= 4 then T := MyString else T := MyString2; Pass := True; MS := TMemoryStream.Create; try SL := TStringList.Create; try for I := 0 to 1000 do SL.Add(T); SL.SaveToStream(MS, Encoding); finally SL.Free; end; MS.Position := 0; SR := TStreamReader.Create(MS, True); try while not SR.EndOfStream do begin S := SR.ReadLine; if J = 5 then if S = T then Pass := False; if (S <> T) and (J <> 5) then Pass := False; end; finally SR.Free; end; if Pass then Writeln('PASS ' + Encoding.ClassName + ' ' + IfThen(J < 4, 'MyString', 'MyString2')) else Writeln('FAIL ' + Encoding.ClassName + ' ' + IfThen(J < 4, 'MyString', 'MyString2')); finally MS.Free; end; except on E: Exception do WriteLn('FAIL - Exception=', E.ClassName, '/', E.Message); end; end; end.
QC #: Date Reported: Area:
70197 12/30/2008 VCL
Description: Steps:
[QC Short Description]
When adding a TCategoryPanel by using CreatePanel to a TCategoryPanelGroup it is inserted in the wrong position

[QC Description]
When adding a TCategoryPanel by using CreatePanel to a TCategoryPanelGroup one expects that the newly created is added to the end
(below) the already existing panels, instead it is inserted before the last panel.

Further more there is a check in that function ...
10574: if FPanels.Count = 0 then
... which is pointless because a Panel was just added to the list and Count will always be > 0.

A corrected version should look something like this:

procedure TCustomCategoryPanelGroup.InsertPanel(Panel: TCustomCategoryPanel);
var
LPanel: TCustomCategoryPanel;
begin
FPanels.Add(Panel);
Panel.FPanelGroup := Self;
if FPanels.Count = 1 then // Modified was 0
Panel.Top := 0
else
begin
LPanel := TCustomCategoryPanel(FPanels[FPanels.Count - 2]); // Modified was [FPanels.Count - 1]
Panel.Top := LPanel.Top + LPanel.Height + 1;
end;
Panel.Left := 0;
Panel.Align := alTop;
Panel.Alignment := FHeaderAlignment;
if not (csLoading in ComponentState) then
AutoScrollInView(Panel);
end;


[Edit1]
Note that the current sort/compare function inverts the list of CategoryPanels.

{$IF DEFINED(CLR)}
function ComparePanels(Item1, Item2: TObject): Integer;
{$ELSE}
function ComparePanels(Item1, Item2: Pointer): Integer;
{$IFEND}
begin
Result := TCustomCategoryPanel(Item2).Top - TCustomCategoryPanel(Item1).Top;
if Result > 0 then
TCustomCategoryPanel(Item2).PanelGroup.FReorderPanels := True;
end;

To make the above change of InsertPanel() more reliable the "compare line" should be changed to ...

Result := TCustomCategoryPanel(Item1).Top - TCustomCategoryPanel(Item2).Top;

... first reaction is that the following line should also be changed to ...

if Result < 0 then

... but without further testing that complete statement looks a little strange in a QuickSort algorithm ;-)
QC Entry 70197
1) Create e new VCL application 2) Drop a TCategoryPanelGroup in the form 3) Add three or more CategoryPanels (rightclick -> New Panel) 4) Add a button and add the following code. procedure TForm1.Button1Click(Sender: TObject); var CategoryPanel: TCategoryPanel; begin CategoryPanel := CategoryPanelGroup1.CreatePanel(Self) as TCategoryPanel; CategoryPanel.Caption := 'CategoryPanel' + IntToStr(CategoryPanelGroup1.Panels.Count); end; 5) Compile and run and press the button Actual result: CategoryPanel1 CategoryPanel2 CategoryPanel4 CategoryPanel3 Expected result: CategoryPanel1 CategoryPanel2 CategoryPanel3 CategoryPanel4
QC #: Date Reported: Area:
70221 1/2/2009 SOAP
Description: Steps:
[QC Short Description]
SOAP attachments broken/not working -> demo echoservice crashes

[QC Description]
The demo echoservice ($(BDS)\Demos\DelphiWin32\VCLWin32\WebServices\EchoService is revealing a total failure with soap attachments. The client hangs, consumes all of the virtual memory until a crash out-of-memory occurs.

Hint:
The Getheaders Procedure in SoapAttach.pas loops endless.

There seems to be a broken conversion to unicode enabling. The demo in Delphi 2006 works.
QC Entry 70221
1. Build the demo 2. Run the Web App debugger 3. Run the client, 4. In Register Attachment, 5. Update File List, 6. Select a file and download -> Hang.
QC #: Date Reported: Area:
70261 1/4/2009 IDE\Search\Find in Files
Description: Steps:
[QC Short Description]
[Regression] Regular expressions result representation differs from "Find" representation in editor

[QC Description]
Some days ago I replaced 2008 by 2009 in the JVCS copyright string. I thought afterwards "How could I find 2008 occurrences in strings?" (just searching for 2008 would find almost only comments). I tried regular expressions, that worked, but I didn't understand how "Find in Files" highlights the results. I compared it with RAD Studio 2007, noticed that there it is highlighted as expected and so this is regression.

-> see steps and attached pictures
QC Entry 70261
0. start Delphi 2009 1. create a new Delphi Win32 console application (or use the attached file FindInFilesRegExTest.dpr and go to step 3.) 2. paste the following code into the project source const cProductInf = ' © 2002-2008 JEDI VCS (http://jedivcs.sf.net) - '; SomeTextConst1 = 'program begin something end'; SomeTextConst2 = 'begin something end'; SomeTextConst3 = 'beginsomethingend'; 3. search with "Find" for '.*2008.*' or '{.*}2008{.*}' (enable [x] Regular expressions!) expected: the whole string of the constant cProductInf is selected actual: as expected 4. do the same with "Find in Files" expected: the whole string of the constant cProductInf is bold actual: - with '.*2008.*' is the part "2002-2" bold (html like -> ...cProductInf = ' © <b>2002-2</b>008 JEDI VCS...) see FiF2008V1Results.png for the result with Delphi 2009 and RAD Studio 2007 - with '{.*}2008{.*}' is the part "2002-2008" bold (html like -> ...cProductInf = ' © <b>2002-2008</b> JEDI VCS...) see FiF2008V2Results.png 5. repeat 3. and 4. with the following expressions and compare the results of 3. and 4. expressions: begin{.*}end' -> results see FiFBeginEndV1Results.png 'begin{.*}end' -> results see FiFBeginEndV2Results.png '{.*}begin{.*}end' -> results see FiFBeginEndV3Results.png
QC #: Date Reported: Area:
70297 1/5/2009 VCL\Additional Controls\TSpeedButton
Description: Steps:
[QC Short Description]
First character of caption is clipped

[QC Description]
The left of the first character is often clipped. The error is generally only one pixel, but it can be a problem especially with charcters with diacriticals.

The problem is also present in TBitBtn.

A standard capital T in Tahoma at 8 point is visibly assymetrical. A character that demonstrates the issue well is a lower case latin small letter I with diaeresis (U+00EF). The left hand dot above the vertical line is generally lost.

The effect is visible with or without themes.

The code measures the required size for the text using the OS DrawText call, and uses the returned rectangle to set the size of a clipping rectangle when displaying it.

It seems the OS clips the text. From the SDK documentation for DrawText: "Note that text with significant overhang may be clipped, for example, an initial "W" in the text string or text that is in italics." There is no matching comment in DrawThemeTextEx which is also used in some circumstances, but it seems to have the same issues as DrawText.

Standard Windows buttons do not suffer the effect.

Possible solutions would be to expand the measured rectangle slightly or to add a DT_NOCLIP flag in the DoDrawText calls in TButtonGlyph.DrawButtonText (Buttons.pas).

The problem was present back in Delphi 7, but was not generally seen because it depends on the font. D7 normally uses MS Sans Serif - and the fault does not show with that, but changing the font to Tahoma makes it perform just the same as current versions of Delphi.
QC Entry 70297
Place a TSpeedButton on a form and set its caption to U+00EF using Tahoma as a font, size 8. Note that the left hand side of the diaeresis is clipped off.
QC #: Date Reported: Area:
70521 1/14/2009 Database\Data Aware Controls\TDBGrid
Description: Steps:
[QC Short Description]
DBGrid-InplaceEditor ignores pasted text

[QC Description]
The DBGrid InplaceEditor ignores text that was pasted from the clipboard if the field has an EditMask.

This is because the TCustomMaskEdit overrides the WM_PASTE (and WM_CUT) message handler and if as mask is specified, the default handler isn't called. The default handler sends a WM_COMMAND(EN_CHANGE) to the parent but without calling the default handler this message isn't sent to the DBGrid and the content of the edit is never copied to the internal InplaceEdit text field.
QC Entry 70521
1. Open the attached project 2. Start the project (This will copy '12.12.08' into the clipboard) 3. Click into the FLD_DATE field in the grid (show inplace editor) 4. Paste the clipboard text into the control by pressing Ctrl+V 5. Use TAB, ENTER or the mouse to leave the edit mode Expected: '12.12.08' is now in the field. Actual: The field is still empty.
QC #: Date Reported: Area:
70553 1/15/2009 RTL\Delphi\Other Classes\TStreamReader/TStreamWriter
Description: Steps:
[QC Short Description]
TStreamReader hangs in an endless loop

[QC Description]
If a TStreamReader is created with an encoding that does not match the encoding of the stream, TStreamReader hangs in an endless loop.

I haven't tested if the crash also happens if a stream is broken.

SR := TStreamReader.Create(MS, TEncoding.UTF8);

It also hangs when reading a Unicode stream with DetectBom = False:

SR := TStreamReader.Create(MS, False);


Try changing MyString in the steps to:
MyString2 = #$1FFFF + mystring;

This does not hang indefinitely, but takes very long to read. This is probably invalid for UTF8, but it should come to that conclusion much sooner.
QC Entry 70553
program Bug; {$APPTYPE CONSOLE} uses SysUtils, Classes, StrUtils; var I, J: Integer; SL: TStringList; MS: TMemoryStream; SR: TStreamReader; S, T: string; Encoding: TEncoding; Pass: Boolean; const MyString = 'Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test '; MyString2 = #955#955#955#955#955#955#955#955#955#955'Test'#228#228#228#228#228#955#955#955#955#955#955#955#955#955#955#968#968#968#968#968; begin for J := 0 to 7 do begin try case J mod 4 of 0: Encoding := TEncoding.Default; 1: Encoding := TEncoding.UTF8; 2: Encoding := TEncoding.Unicode; 3: Encoding := TEncoding.BigEndianUnicode; else raise Exception.Create('Bug in Testprogram'); end; if J <= 3 then T := MyString else T := MyString2; Pass := True; MS := TMemoryStream.Create; try SL := TStringList.Create; try for I := 0 to 1000 do SL.Add(T); SL.SaveToStream(MS, Encoding); finally SL.Free; end; MS.Position := 0; SR := TStreamReader.Create(MS, TEncoding.UTF8); try while not SR.EndOfStream do begin S := SR.ReadLine; if J = 4 then if S = T then Pass := False; if (S <> T) and (J <> 4) then Pass := False; end; finally SR.Free; end; if Pass then Writeln('PASS ' + Encoding.ClassName + ' ' + IfThen(J < 4, 'MyString', 'MyString2')) else Writeln('FAIL ' + Encoding.ClassName + ' ' + IfThen(J < 4, 'MyString', 'MyString2')); finally MS.Free; end; except on E: Exception do WriteLn('FAIL - Exception=', E.ClassName, '/', E.Message); end; end; end.
QC #: Date Reported: Area:
70591 1/17/2009 Database\DBExpress\TSQLConnection
Description: Steps:
[QC Short Description]
SQLConnection Problems in Update3

[QC Description]
Th SQLConnection has a backward problem again. No driver options again .
I´m using Vista x64 SP2 ...
QC Entry 70591
Steps to reproduce : - Create a new application - Put a SQLConnection - Change Driver property in Object Inspector - Click on + Nothing appear ... I´m using Vista x64 SP2 ...
QC #: Date Reported: Area:
70869 1/26/2009 IDE\Object Inspector
Description: Steps:
[QC Short Description]
Scrollbars in Object Inspector missing or imcomplete scroll range

[QC Description]
This is a regression in Build #3300, it worked fine in Update 2 (verified).

When selecting a control and then running an application, the scrollbars will be missing from the object inspector when the application exits.

I'm using Vista 64 with a screen resolution of 1680x1050.
QC Entry 70869
1. make sure that the IDE is using the "Default Layout" (Docked) 2. Make sure that the object inspector is showing scrollbars 3. File -> New VCL Forms application 4. Put a TImage on the form 5. Select the TImage 6. Press F9 to run the application 7. Close the application ==> The Object Inspector doesn't have scrollbars anymore; not all items are visible Repeat the steps from above, but now use a TEdit instead ==> The object inspector for the TEdit has scrollbars, but you can only scroll until PopupMenu. The text property is not visible at all. You cannot access the text property unless you resize the Object Inspector. It is not enough to just select the Form, and then select the TEdit again.
QC #: Date Reported: Area:
71082 2/3/2009 Database\DataSnap\Server
Description: Steps:
[QC Short Description]
TDataSetProvider.OnDataRequest fails with variant error

QC Entry 71082
UnitTest: http://dtg-svn/svn/bdstests/trunk/UnitTest/projects/database/datasnap/rdm/native32/DataSnapRDM.Native.DB.Test.dpr

-sTest_AS_DataRequest.

Server:
Setup a basic DataSnap server with a TSQLConnection, TSQLDataSet, and TDataSetProvider (and TDSServer, TDSServerClass, TDSTCPServerTranspot for DataSnap 2009 connectivity).

Add an event handler for TDataSetProvider.OnDataRequest to do something simple, like setting the result to the input parameter.

Client:
Setup a basic DataSnap client with a TSQLConnection, TDSProviderConnection, and TClientDataSet. Hook everything up so the data set gets data from the data set in the server.

Call TClientDataSet.DataRequest. The server will throw a variant exception.

Cause:
The problem appears to be in DSServer.pas:TDSProviderDataModuleAdapter.AS_DataRequest. The local Data: OleVariant variable is being assigned DataStream.AsVariant. The problem is that DataStream is already an OleVariant, and Variants evidently don't know how to convert themselves to a Variant. :)

Seriously though, this results in Variants.pas:_DispInvoke being called against the DataStream variant. _DispInvoke doesn't know how to handle basic variant types (like varInteger and VarOleStr), so FindCustomVariantType fails to find a handler, and VarInvalidOp is called.

The problem is solved by changing this line in DSServer.pas from:
Data := DataStream.AsVariant;
to
Data := DataStream;

Or, alternatively, remove the local Data variable completely and change this line:

Result := FProviderDataModule.Providers[ProviderName].DataRequest(Data);
to
Result := FProviderDataModule.Providers[ProviderName].DataRequest(DataStream);

I did the latter and saved a copy in my project folder, rebuilt the server, and the error was resolved.
QC #: Date Reported: Area:
71123 2/3/2009 Database\Data Access Controls\TQuery
Description: Steps:
[QC Short Description]
Param data string truncation with 2byte char in TParam and BDE

[QC Description]
When passed 2byte char string to TParam of TQuery, data truncates as if the string is made up of only 1byte char.

This seems because of VCL bugs in 2 location.
In line 9596 in DB.pas,
Result := Length(VarToStr(FData)) + 1;
this should be,
Result := Length(AnsiString(VarToStr(FData))) + 1;

And line 1457 in DBTables.pas,
AnsiToNativeBuf(DrvLocale, PAnsiChar(AnsiString(NativeStr)), Buffer, Length(NativeStr) + 1) else
this should be,
AnsiToNativeBuf(DrvLocale, PAnsiChar(AnsiString(NativeStr)), Buffer, Length(AnsiString(NativeStr)) + 1) else

I think there is some other points to correct like above, like BLOB text handling.
QC Entry 71123
Run an attached project under Japanese locale.

1. Click "Create Table" button. TestTbl.DB is created, and DBGrid will display data.
2. Click "Query SBCS" button. DBGrid display 1 line what we expected.
3. Click "Query DBCS" button.

Exp: One data record display on DBGrid. F1 field is 2. (F2 is DBCS character)
Act: No record is selected.

D2007 works fine.
QC #: Date Reported: Area:
71242 2/6/2009 SOAP\Client Applications
Description: Steps:
[QC Short Description]
Error using TSOAPConnection

[QC Description]
Error using TSoapConnection in a project DataSnap with a Server type SOAP Server Application and SOAPDataModule.
When configure client application in TSOAPConnection component and configure TClientDataSet with the properties RemotServer, ProviderName everything ok. But when set ClientDataSet.Active = True then raise a exception. Sama times with the message "variant or safe array is locked" order times only "Access violation..."

In the demo C:\Users\Public\Documents\RAD Studio\6.0\Demos\DelphiWin32\VCLWin32\WebServices\SOAPDataModule raise the same error.
QC Entry 71242
- Create a new application of type SOAP Server Application as Web App Debuger - Add a new SOAP Server DataModule - Drop into new SOAP Server DataModule a TSQLConnection, a TSQLDataSet and a TDataSetProvider - Set a valid configuration for SQLConnection - Set the property SQLConnection to TSQLConnection component, set a valid SELECT statement in CommandText of the TSQLDataSet - Set the property DataSet of the TDataSetProvider to TSQLDataSet component - Run application to register - Run Web App Debuger and click on button Start. Then click on link to localhost server - A web browser will opened - Then click on register of the yuor application and click on RUN button - The ServerInfo application will run and your SOAP Server Application too - Then create a new VCL Forms Application and drop on main form a TSOAPConnection component and a ClientDataSet component - Configure the property URL of the TSOAPConnection component (ex. http://localhost:8081/prServerSOAP.SOAPTeste/soap) - Set the property Connected = True of the TSOAPConnection component - Set the property RemoteServer of the TClientDataSet component to TSOAPConnection component - Set the property ProviderName of the TClientDataSet component to TDataSetProvider's name in SOAP Server Application (and this appers to set normally) - Then try set property Active = True of the TClientDataSet componet then raise exception
QC #: Date Reported: Area:
71291 2/9/2009 SOAP\Server Applications
Description: Steps:
[QC Short Description]
SOAP Attachments don't work in D2009 because the MIME headers and boundary info are getting widened due to incorrect use fo the 'string' type.

NOTE: This issue has been reported by Bob Swart on the beta forum and escalated by a customer.



[ORIGINAL REPORT:]
SOAP server (cgi stand-alone) does not work on apache

[QC Description]
SOAP service deployed as a cgi application on Apache returns incorrect SOAP response (see below).

The same service compiled with Delphi 2006 and before does work.

Tested with Apache 2.0.39 and 2.2.10.

ResponseCode: 200 (OK)
Date:Mon, 09 Feb 2009 11:46:34 GMT
Server:Apache/2.2.10 (Win32)
Content-Version:MIME-Version: 1.0
Content:
Content-Length:704
Content-Type:multipart/related; boundary=MIME_boundaryB0R9532143182121; start="<http://www.borland.com/rootpart.xml>"

0: 0D 00 0A 00 2D 00 2D 00 4D 00 49 00 4D 00 45 00 ....-.-.M.I.M.E.
16: 5F 00 62 00 6F 00 75 00 6E 00 64 00 61 00 72 00 _.b.o.u.n.d.a.r.
32: 79 00 42 00 74 00 2D 00 54 00 79 00 70 00 65 00 y.B.t.-.T.y.p.e.
48: 3A 00 20 00 6D 00 75 00 6C 00 74 00 69 00 70 00 :. .m.u.l.t.i.p.
64: 61 00 72 00 74 00 43 00 6F 00 6E 00 74 00 65 00 a.r.t.C.o.n.t.e.
80: 6E 00 74 00 2D 00 54 00 79 00 70 00 65 00 75 00 n.t.-.T.y.p.e.u.
96: 6E 00 64 00 61 00 72 00 79 00 3D 00 4D 00 49 00 n.d.a.r.y.=.M.I.
112: 4D 00 45 00 5F 00 43 00 6F 00 6E 00 74 00 65 00 M.E._.C.o.n.t.e.
128: 6E 00 74 00 2D 00 49 00 44 00 3A 00 20 00 3C 00 n.t.-.I.D.:. .<.
144: 68 00 74 00 74 00 70 00 3A 00 2F 00 2F 00 77 00 h.t.t.p.:././.w.
QC Entry 71291
1. create new SOAP Server application (cgi stand-alone application) with sample methods 2. deploy on Apache 3. Call with soap client (e.g. SoapUI)
QC #: Date Reported: Area:
71577 11/13/2008 8:43:54 PM IDE\ToDoList
Description: Steps:
ToDo list does not display todo comment if a source code is ANSI, and todo commnet contains a character outside us-ascii.

All accented character, copyright mark and DBCS characters have same problem.

Especially, It is too important for DBCS user. They (and I) usually use DBCS character in ToDO comment.
Open attached project file.
IDE loads Project1(.pas) file into editor.
Open ToDo list.

You will find three ToDo list. If not, check "Current project source files" in "Filter To-Do List" dialog.


A ToDo item in Unit1_1252.pas in To-Do List is
"An encoding is ANSI....."

Double click this item. Unit1_1252.pas is loaded.
You can find actual ToDo list is started with Cipyright mark.

If you change the text in Unit1_1252.pas, ToDo list will display correct comment.