Release Notes for CodeGear RAD Studio 2007

This file contains important supplementary information that might not appear in the main product documentation. CodeGear recommends that you read this file in its entirety. For an updated version of these Release Notes, see the CodeGear Developer Network (http://dn.codegear.com/article/36858).

This document refers to "the product" when the information applies to all three personalities in CodeGear RAD Studio 2007: Delphi 2007 for Win32, Delphi 2007 for .NET, and C++Builder 2007.

For information about installation, deployment, and licensing issues, see the Install, Deploy, and License files located, by default, at C:\Program Files\CodeGear\RAD Studio\5.0.

Contents

 

Installing, Uninstalling, and Upgrading Your Product

Top

 

General Notes

Top

 

Known Problems

Cannot Use Dynamic Link RTL if Dynamically Load DLL

If you dynamically load a DLL, you can't link dynamically with the runtime library. Otherwise, an Access Violation occurs when the program terminates. The workaround is to not check Dynamic RTL in the Linking section in Project Options on the Linker\Linking page.

Must Turn off NO_STRICT #define with GdiPlus library

The C++ library GdiPlus cannot be used in non STRICT mode, since it requires that Graphics::Graphics(HDC) be distinguishable from Graphics::Graphics(HWND). In non STRICT mode, both HWND and HDC are "void*". Otherwise, you get the error:

[C++ Error] GdiplusGraphics.h(37): E2015 Ambiguity between 'Gdiplus::Graphics::Graphics(void *)' and 'Gdiplus::Graphics::Graphics(void *,int)'

ActiveX

The Register and Unregister menu items are not enabled if you open and run an ActiveX library project in C++ Builder 2007 that was created with C++ Builder 6. The work around is to go to Run>Parameters and set Host application to "C:\windows\system32\regsvr32.exe" and the Parameters to <ProjectName>.

 

Change Assembly Search Path If You Are Upgrading Either Delphi 2007 for Win32 or C++Builder 2007

If you install RAD Studio after having either Delphi 2007 for Win32 or C++Builder 2007 installed, you need to change the Assembly search path so that RAD Studio can find assemblies. Follow these steps:
  1. Select Component > Installed .NET Components.
  2. Locate the following search path: C:\Program Files\Common Files\Borland Shared\BDS\Shared Assemblies\5.0\
  3. Change it to: C:\Program Files\Common Files\CodeGear Shared\RAD Studio\Shared Assemblies\5.0.

Top

 

ASP.NET Notes

 

Top

 

Blackfish SQL Notes

Blackfish SQL is a high performance transactional database that originated as JDataStore and is now available in RAD Studio 2007.

Top

 

Windows VistaTMNotes

Top

 

C++Builder and C++ Compiler Notes

Possible Binary Incompatibility with Previous Version of C++ Compiler

The C++ runtime libraries have been enhanced and altered to be more current, and the standard C++ libraries from Dinkumware have been updated to version 5.01. Because of these changes, the binary objects generated by the compiler in C++Builder 2007 might differ in some cases from previously compiled versions. The incompatibilities are mainly restricted to the C++ standard libraries. There are no changes in the basic C++ application binary interface (ABI).

Delphi Interface Parameter with Default Value of nil Handled Differently
Assigning the Type void * to Delphi Interface Now Fails to Compile

The Delphi compiler (DCC32) previously generated the following code in the .hpp file when an interface parameter had the default value of nil:

  void methodName(_di_IIntf param = (void *)(0x0));

Previously the C++ compiler incorrectly accepted this syntax.

In this release, both the Delphi compiler and the C++ compiler handle this case differently.

The Delphi compiler now emits code like this in the .hpp file for an interface parameter with a nil default value:

  void methodName(_di_IIntf param = _di_IIntf());

The C++ compiler now gives an error for code that assigns the type "void *" to a Delphi interface. For instance, the line

  void methodName(_di_IIntf param = (void *)(0x0));

now fails to compile, emitting the error:

  Cannot convert 'void *' to '_di_IIntf'

If you have Delphi code containing an interface parameter with a nil default value, recompile it with DCC32. If you do not have the source, edit the .hpp file and modify all occurrences like this

  void methodName(_di_IIntf param = (void *)(0x0));

to this:

  void methodName(_di_IIntf param = _di_IIntf());

Selecting Both of the Symbol Reference Info Options for Delphi Code

If you are compiling Delphi code inside your C++Builder project, you currently can select only one of the Symbol Reference Info options (either Definitions or Reference Info) on the Project>Options>Delphi Compiler>Compiling dialog box. However, you can select both of these options if you use source-level directives ($xx) as follows: These compiler options are only available when both the Debugging Information ($D) and the Local debug symbols ($L) options are ON.

Specifying WebSnap Directories

If you are using C++Builder with WebSnap, ensure that the executables are written to the same directory as the HTML files. On Project>Options>Paths and Defaults>Final Output, enter a dot (".") so that the executable is written to the project directory.

Location Change for Precompiled Headers

C++ precompiled header files (PCH) are placed in a different file location than BDS2006. If you import a project from BDS2006, it does not import the project's PCH file location. You can set the PCH file in Project>Options>Precompiled headers>PCH filename.

Generating C++ Files from the Delphi Compiler

If you want to generate .hpp files (and the corresponding .obj) from a .pas file, you should use dcc32.exe with the -JPHNE switch. Or use -JL on the .dpk file containing the .pas file.

Using the Delphi DesignIntf and DesignEditors Tools

If you are creating a C++ package that contains a Delphi unit that uses the DesignIntf and DesignEditors tools, you must choose Project > Options > Delphi Compiler > Other Options. In Use these packages when compiling, add DesignIDE in the combo box.

Using WinHelp in C++ Applications

To use WinHelp in a C++ application:

  1. Add #include <WinHelpViewer.hpp>.
  2. Refer to an object declared in the WinHelpViewer header file.

    void LinkWinHelp()

    {

      # pragma startup LinkWinHelp 66

      if (WinHelpTester != NULL)

            WinHelpTester->GetHelpPath();

    }

To download the WinHelp viewer, visit the Microsoft website:

http://www.microsoft.com/downloads/details.aspx?familyid=6ebcfad9-d3f5-4365-8070-334cd175d4bb.

C++ Compiler Changes

To more closely obey the rules of the C++ ANSI Standard, the C++ compiler shipping with C++Builder 2007 is stricter than previous versions. Code that did not generate errors in earlier versions of C++Builder might fail to compile with C++Builder 2007. This section lists some of the common areas where the compiler is stricter. Each case is illustrated with an example showing the problem and how to update the code to compile with C++Builder 2007. Note that there are often many ways to bring offending code up to date. The appropriate method depends on the intent of the original code.

Binding of References and Qualifiers

There are many constructs that now generate error messages with the C++ compiler included with C++Builder 2007. The rules governing this are described in section 8.5.3 of the 2003 C++ ANSII standard. They fall in the following categories:

  1. Binding a non-const lvalue to to non-const reference. Use the compiler switch -Vbr to allow this.
  2. Binding a temporary to a non-const reference. Use the compiler switch -Vbr to allow this.
  3. Binding of const or volatile objects to non-const or non-volatile methods repectively. Use the compiler switch -Vbn to allow this.

Previous versions of the Borland C++ compilers allowed various forms of binding to non-const reference parameters. In the following example, for instance, one was allowed to simply cast the psize parameter:

  int takesLongRef(long& l);

  int takesUnsignedPtr(unsigned long* psize) {

     return takesLongRef((long)*psize);
  }

With C++Builder2007, the above code generates these errors:

  Error E2357 test.cpp 3: Reference initialized with 'long', needs lvalue of type 'long' in function takesUnsignedPtr(unsigned long *)

  Error E2342 test.cpp 3: Type mismatch in parameter 'l' (wanted 'long &', got 'long') in function takesUnsignedPtr(unsigned long *)

To remedy this, you can cast psize before dereferencing, as in:

  int takesLongRef(long& l);

  int takesUnsignedPtr(unsigned long* psize) {
    return takesLongRef(*reinterpret_cast<long*>(psize));
  }

Be aware of cases that involve temporaries in unobvious ways. For example, some binary operators imply a temporary:

  enum { zero, one, two } num;

  num |= two; // Not allowed
  num = num | two; // OK

Another case that involves temporaries in an unobvious way is the return value of a property. The following example illustrates code that compiled with previous versions of the compiler:

  #include <vcl.h>

  class TTest {
    WideString FData ;
  public:
    __property WideString Data = {read = FData };
  };

  void Func(WideString& wref);

  void test() {
    TTest t;
    Func(t.Data);
  }

With C++Builder 2007, the above generates two errors:

  Error E2357 test.cpp 14: Reference initialized with 'const WideString', needs lvalue of type 'WideString' in function test()
  Error E2342 test.cpp 14: Type mismatch in parameter 'wref' (wanted 'WideString &', got 'WideString') in function test()

You can fix this by changing the reference to a const reference, as in:

  void Func(const WideString& wref);

Here is an example of trying to bind a const object to a non-const method:


  struct X {
    void foo();
  };
  const X x;
  x.foo(); //error

1.1 Reconcile Error Dialog

The temporaries and references issue referred to above is encountered in code generated by previous versions of the Reconcile Error Dialog Wizard. To remedy this, look for the VarToAnsiStr method


  AnsiString VarToAnsiStr (Variant &V, TFieldType DataType)

and change it to take a const Variant&, as in:

  AnsiString VarToAnsiStr (const Variant &V, TFieldType DataType)

2. String literals are now constants

String literals are now considered to be of type 'const char[]' by default. This, combined with the stricter qualification binding of const values and types, can generate error messages in code that compiled before.

You may enable the -Vbs switch to revert string literals to non-const. However, CodeGear recommends that you update the code instead.

Note that the change in the type of string literals can also change how the compiler resolves calls to overloaded methods. The following example illustrates this:

  void foo(char *);
  void foo(const char *);
  foo("string"); // New Compiler picks foo(const char *)

3. Template Changes

The C++ compiler no longer allows an explicit template without the 'template <>' prefix. Use the compiler switch -Vbe to allow this. The following example shows this:

  template<class>
  class foo {
    foo();
  };
  foo<int>::foo(); // Error
  template<> foo<int>::foo(); // OK

Also, the C++ compiler no longer allows explicit template specialization within a class. Use the compiler switch -Vbx to allow this. For example, this generates an error:

  struct S {};
  struct SP
  {
    template <typename T> void foo(const T &) {}
    template <> void foo(const S &) {} // Error
  };

  template <> void SP::foo(const S &) {} //OK

4. Function Overload Resolution

One of the areas where the C++Builder 2007 compiler differs the most from the previous version is in overload resolution, which includes the detection of ambiguity. The compiler now better conforms to the rules in section 13.3 of the 2003 C++ ANSI Standard. Several constructs that were previously allowed might now be reported as ambiguous or no match found, requiring that you modify code to clarify its intent.

The compiler option to revert to the old behavior, not enforcing the new stricter behavior, is -Vbo. However, not all compiler changes can be controlled by this switch, so CodeGear recommends that you update the code instead.

The following is an example of an ambiguity that was permitted by the previous compiler:

  class X{};
  void foo(X);
  void foo(const X&);
  void ambig() {
    X x;
    foo(x); //error-ambiguous-the previous compiler chose 'void foo(x)'
  }

4.1 std::abs() Ambiguity

The standard abs function might also generate an ambiguity message when invoked with a parameter that does not exactly match the types expected by the various overloaded versions of abs. Here is an example:

  #include <limits>
  bool test(long l) {
    return std::abs(l) > 0;
  }

The code above generates an error and a warning:

  Error E2015 test.cpp 5: Ambiguity between 'std::abs(int) at C:\dev\tp\sc\include\math.h:208' and 'std::abs(long double) at C:\dev\tp\sc\include\math.h:275' in function test(long)
  Warning W8057 test.cpp 6: Parameter 'l' is never used in function test(long)

To fix this, cast to the type of the overload you wish to invoke. For example,

  #include <limits>
  bool test(long l) {
    return std::abs(static_cast<int>(l)) > 0;
  }


5. Initialization and Conversion

The compiler now obeys the rules of 8.5.1 and 13.3.1 of the 2003 C++ ANSI Standard for initialization and conversion:

  1. Direct initialization now requires initialization by a constructor and no longer picks a user conversion sequence.
  2. Copy initialization for objects of the same or derived type now requires a constructor call.
  3. Copy initialization for objects of the different types no longer prefers user conversion over construction. If the compiler finds a suitable user conversion, it now continues to look for (possibly ambiguous) converting constructors. If the chosen conversion function is a converting constructor, the call initializes a temporary of the destination type. The result of the call (which is the temporary for the constructor case) is then used to directinitialize the object. Use the compiler switch -Vbo to revert to the previous behavior.
  4. For an explicit cast, the compiler now performs direct initialization on a temporary.

This example illustrates the new behavior:

  // In this example, dst is destination type and src is source type
  class A { };
  class V {
  public:
    V() { };
    V( const V & ) { }
    V( const A & ) { }
  };
  class G {
  public:
    G() { }
    operator V() { }
    operator A() { }
  };
  G g; V v;
  // direct initialization
  // ==> constructors are considered.
  V v9(g);
  // Both of these statements previously compiled but now get the error:
  // Error E2015: Ambiguity between 'V::V(const V &)' and 'V::V(const A &)'

  // casts
  // (V)g is treated as V tmp(g) which is direct initialization of 'tmp'
  // ==> constructors are considered.
  (V)g;
  static_cast<V>(g);
  // Both of these statements previously compiled but now get the error:
  // Error E2015: Ambiguity between 'V::V(const V &)' and 'V::V(const A &)'

  // copy initialization with dst=V src=G
  // ==> user-defined conversion sequences are considered.
  V v4 = g;
  V v5 = G();
  // Both of these statements now compile but previously got the error:
  // Error E2015: Ambiguity between 'V::V(const A &)' and 'V::V(const V &)'

  // copy initialization with dst=V src=V
  // ==> converting constructors of V are considered.
  V v6 = (V)g;
  V v7 = V(g);
  // Both of these statements compiled previously but now get the error:
  // Error E2015: Ambiguity between 'V::V(const V &)' and 'V::V(const A &)'

5.1 Conversion via user-defined operators

The new C++Builder 2007 compiler often reports ambiguities for conversions that involve user-defined operators. An example is shown below:

  class AnsiString
  {
  public:
    bool operator ==(const AnsiString& other);
    AnsiString(const wchar_t* src);
  };

  class Variant
  {
  public:
    operator AnsiString() const;/br>     operator wchar_t*() const;
    bool operator ==(const AnsiString& rhs) const
    { return static_cast<AnsiString>(*this) == rhs;}
  };

C++Builder users might notice that the above is a stripped down version of the VCL AnsiString and Variant classes. Previous versions of the compiler invoked the 'Variant' 'operator AnsiString() const' for 'static_cast<AnsiString>(*this)', while C++Builder 2007 uses 'conversion via constructor'. Since the Variant can be converted to multiple types for which there are AnsiString constructors, the compiler generates an ambiguity error.

To correct this error, you must eliminate the cast as in:

  bool operator ==(const AnsiString& rhs) const
  { return (*this) == rhs;}

You can also be explicit about the operator:

  bool operator ==(const AnsiString& rhs) const
  { return this->operator AnsiString() == rhs; }

5.2 Variant/OleVariant/AnsiString/WideString/TDateTime

The issue described above with a user-defined conversion operator vs. conversion via constructor might be encountered in several constructs involving the VCL classes Variant, OleVariant, AnsiString, WideString, TDateTime, Currency, and so forth. The following table lists constructs that now generate error messages and the updated syntax.

Previous Construct Updated Construct Notes
AnsiString test(OleVariant v) {
  AnsiString ret = (AnsiString) v;
  return ret;
}
AnsiString test(OleVariant v) {
  AnsiString ret = /*(AnsiString)*/ v;
  return ret;
}
Do not cast RHS when relying on conversion operator in an assignment.
WideString test(OleVariant v) {
  WideString w(v);
  return w;
}
WideString test(OleVariant v) {
  WideString w = v;
  return w;
}
Use Copy Initialization instead of the more direct constructor.

The underlying compiler change for the errors described above is related to the way the compiler now handles initialization and conversion.

Top

 

Command Line Notes

You can now build projects from the command line using the MSBuild executable. Select Start Programs>CodeGear RAD Studio>RAD Studio Command Prompt to automatically set both the path to the MSBuild executable and the environment variable for the product.

These are the environment variables set by the RAD Studio Command Prompt for using the CodeGear RAD Studio tools, especially MSBuild:

   BDS=c:\program files\CodeGear\RAD Studio\5.0
   FrameworkDir=c:\Windows\Microsoft.NET\Framework
   FrameworkVersion=v2.0.50727

If you want to use MSBuild on the command line but are not using the RAD Studio Command Prompt, you should set these environment variables yourself.

For more information about using MSBuild, look up MSBuild in the Index or Contents of the online help.

Top

 

Database Notes

Upgrading dbExpress for Delphi 2007 for Win32

If you have been using dbExpress with Delphi 2007 for Win32, and you upgrade your copy of Delphi 2007 for Win32, you do not need to make any source code changes. However, you do need to recompile any code that uses the SQLExpr or DbxCommon units, two units that have changed since the first shipment of Delphi 2007 for Win32.

Adding a Connection String in dbExpress (.NET Personality)

Do not use the Connection string generated from the Data Explorer. Instead, use either of the following two ways to add a connection string:

Note that to support Unicode string access for Interbase, connectionString or dbxconnection.ini has to have the key property: ServerCharSet=UNICODE_FSS.

Use AdoDbxClient Instead of BDP

BDP (Borland Data Provider) has been placed at stage 1 of the product deprecatation process. This means that BDP will be removedfrom the product at some point in the future. Although BDP currently remains in the online help, the use of BDP is discouraged. Instead, you should use the new AdoDbxClient, which is fully documented in the Borland.Data.AdoDbxClientProvider namespace.

Known Problems

New features

dbExpress 4 Framework

Delphi database driver Framework. This is an object oriented driver Framework written in Delphi.

Delegate driver support. A delegate driver is a driver between the application and the actual driver. Delegate drivers allow for pre and post processing of all public methods and properties of the dbExpress 4 Framework. Delegate drivers are useful for connection pooling, driver profiling, tracing, and auditing. Delegate drivers are easy to implement. See the source documentation at the beginning of the DBXCommon unit for more information.

TDBXPool delegate driver. Provides connection pooling for any dbExpress driver.

TDBXTrace delegate driver. Provides enhanced tracing capability. Produces Delphi code for all traced methods and properties.

Extensible Commands. Commands that are not SQL statements or stored procedures are supported by specifying a custom "command type" property. This property is a String allowing driver and delegate driver implementers to introduce their own command type namespace of custom commands. The TDBXPool delegate driver leverages this capability to implement a "show pools" command, which returns a reader with information on the current state of all connection pools.

Source code documentation. Works with help insight for all public methods, properties, and events. XML/HTML documentation can also be generated using the --doc Delphi compiler switch.

Single source. dbExpress 4 source code can be compiled for both Win32 and .NET platforms.

dbExpress 4 source code. Full source code is provided for the dbExpress 4 Framework.

Dual interfaced drivers. All CodeGear dbExpress drivers implement the older dbExpress 3 and newer dbExpress 4 interfaces.

dbExpress 3 adapter driver. The dbxadapter30.dll DLL provides a dbExpress 4 interface for existing dbExpress 3 drivers. This allows applications to still use older non-CodeGear dbExpress 3 drivers with dbExpress 4.

Samples

Single source dbExpress VCL components

The unified code base is much easier to read, debug, and maintain.

VCL now accesses dbExpress database drivers using the new dbExpress 4 Framework.

New database Drivers

New Unicode enabled database drivers

Note that Unicode support for MS-SQL was already in the product.

Oracle dbExpress Unicode and ANSI drivers

Both Unicode and ANSI drivers ship with dbExpress. The Unicode version is dbxoraW30.dll and the ANSI version is dbxora30.dll.

Database Change Notes

dbExpress 2.5 not supported

dbExpress 2.5 is no longer supported in this release.

New MySQL dbExpress driver

The new MySQL driver is called dbxmys30.dll. This driver supports Unicode strings. This driver works only with the version of MySQL's libmysql.dll for MySQL 4.1 and 5.0 servers. dbxmys30.dll does not work with older versions of libmysql.dll.

The old MySQL driver is still included in the product but has been renamed to dbxmysA30.dll. The "A" has been added to the DLL name to signify that this older driver only supports ASCII strings, not Unicode. dbxmysA30.dll can only be used with versions of MySQL's libmysql.dll that support MySQL servers version 4.0 and below.

Delegate drivers

Two delegate drivers are provided:

dbExpress VCL components

Known compatibility issues:

dbExpress application deployment for the Win32 platform

Using packages

Project|Options|Packages must have the Build with runtime packages option checked. DbxCommonDriver100.bpl must be deployed with your application. As with prior releases, if your application uses any of the DBX*.dll dynalink dbExpress drivers, they also must be deployed.

Unit interface compatibility

For the most part, the product maintains unit interface compatibility with BDS2006. However, the dbExpress VCL breaks this compatibility in three units: SQLExpr, DBXpress, and SQLConst. Only SQLExpr contains components. DBXpress has been deprecated. To avoid conflicts with the BDS2006 version of dbExpress100.bpl, dbExpress100.bpl has temporarily been renamed dbExpress4100.bpl. The "4" signifies that this version of the dbExpress package is for version 4 of the dbExpress drivers. When version 11.0 of the VCL ships, the normal VCL naming convention will be resumed and dbExpress4100.bpl will be renamed dbExpress110.bpl.

Supported Servers

dbExpress

* Driver not fully certified with this version of the database.

Top

 

Debugger Notes

Top

 

Documentation Notes

Top

 

International Notes

Top

 

Together Notes

Top

 

VCL/RTL Notes

Creating and Installing a New Component into a New Package

Follow these steps to create a new component and install in the Tool Palette:
  1. Start RAD Studio 2007.
  2. Select File > New > Other > C++Builder Projects or Delphi Projects > Package.
  3. Select File > Save As and give your package a name.
  4. Right-click the package node and select Option from the context menu.
  5. Enter the Description for your package; the description is used in the Install Packages dialog box.
  6. Select Component > New VCL Component, which displays the New VCL Component Wizard (described later).
  7. Select TButton as the ancestor, and click Next.
  8. Accept the defaults for Classname, and so forth, and click Next.
  9. Select View > Project Manager, right-click Package1, and select Install.

The preceding setps will get you a new design time package with a new component installed and on your palette. If you have an existing .PAS file that contains a component(s) all you need to do is right click the Contains node under your package and select Add....

Installing an Existing Component into a New Package

Use the preceding steps, but at step 4 instead of starting the New VCL Component wizard, simply open the .PAS file that contains the component(s) and add it to the Contains node of your package.

Installing Components into an Existing Package

If you have already created and installed a design-time package, use the following steps to add a new component:
  1. Select Component > Install Packages.
  2. Find the desired package and select it in the Design Packages listbox.
  3. Click the Edit button which will prompt you to cancel the dialog and open the package as a project.
  4. Select View > Project Manager.
  5. Expand the package node, right-click the Contains node under the package, and select Add.
  6. Add your existing .PAS file or select Component > New VCL Component and follow the steps in the previous Creating and Installing procedure.
  7. Right-click the package node in the Project Manager and select Compile. This will rebuild and reinstall your design-time package.

Installing Existing Design-Time Packages

If you have existing component packages you want to install on the palette, use the following steps:
  1. Select Component > Install Packages.
  2. Click Add and multi-select the design-time packages you want to install.
  3. Click OK.

Using the New VCL Component Wizard

The New VCL Component Wizard places both design-time and runtime code into a single unit. The runtime code is the code that implements the component itself. The design-time code is the Register procedure with the call to RegisterComponents which should be removed and placed in a different unit which belongs in a design time package.

In the first scenario above, it would be wise to create a second, design-time only package and split the code as described. Additionally, you should mark your packages explicitly as design-time and runtime using Usage Options from the Project Options dialog box. Mixing design-time and runtime code in a single package is a bad idea and needs to be avoided. Design-time code isn't necessary at runtime and typically contains property and/or component editors along with various registration calls that are only meaningful when the package is installed in the IDE.

Top

 

SOAP Server Notes

Top

 

 

Copyright 2007 CodeGear Software. All rights reserved.