Translation Repository

The Translation Repository provides a central database for translations that can be shared across projects, by different developers. While working in the Translation Manager, you can store translated strings in the Repository and retrieve translated strings from the Repository. By default, each time your assemblies are updated, they will be populated with translations for any matching strings that exist in the Repository. You can also access the Repository directly, through its own interface,...

Special Cases

There are cases where a StringBuilder and even the Marshal class will be unable to correctly handle the data that needs to be passed to an unmanaged function. An example of such a case is when the string you need to pass, or receive, contains multiple strings separated by null characters. Since the default marshaler will consider the first null to be the end of the string, the data will be truncated (this also applies to the StringToHGlobalXXX and PtrToStringXXX methods). In this situation...

To create a component template

Place and arrange components on a form. 2. In the Object Inspector, set the component properties and events as desired. 3. Select the components that you want to save as a component template. To select several components, drag the mouse over them. To select all of the components on the form, choose Edit Select All. Gray handles appear at the corners of each selected component. 4- Choose Component Create Component Template. The Create Component Template dialog box is displayed. 5. Specify a...

To open the Expression Editor

Create a new ECO application or open an existing one. 2. In the Model View tab, double-click on the CoreClassesPackage icon. This opens the model diagram surface. 3- Right-click to display the context menu and choose Add Class. 4. Name the class and add any attributes or operations you want. 5. From the Project Manager tab, select the WinForm icon. 6. From the Tools Palette, drag-and-drop an ExpressionHandle onto the Windows Form. 7. Select the root handle (rhRoot). 8. Click the EcoSpaceType...

Array Properties

Array properties are indexed properties. They can represent things like items in a list, child controls of a control, and pixels of a bitmap. The declaration of an array property includes a parameter list that specifies the names and types of the indexes. For example, property Objects Index Integer TObject read GetObject write SetObject property Pixels X, Y Integer TColor read GetPixel write SetPixel property Values const Name string string read GetValue write SetValue The format of an index...

Multidimensional Dynamic Arrays

To declare multidimensional dynamic arrays, use iterated array of constructions. For example, type TMessageGrid array of array of string var Msgs TMessageGrid declares a two-dimensional array of strings. To instantiate this array, call SetLength with two integer arguments. For example, if I and j are integer-valued variables, allocates an I-by-J array, and Msgs 0,0 denotes an element of that array. You can create multidimensional dynamic arrays that are not rectangular. The first step is to...

UML Class Diagrams

The class diagram is both an architectural tool for overall system design, and an organizational tool for both designers and developers. The class diagram, when taken as a whole, allows designers and developers to work at a level of abstraction that is removed from the technical details of a particular platform or language. However, the individual UML elements that compose a class diagram were explicitly designed for the purpose of mapping the abstract system model onto language-specific types...

Threadlocal Variables

Thread-local (or thread) variables are used in multithreaded applications. A thread-local variable is like a global variable, except that each thread of execution gets its own private copy of the variable, which cannot be accessed from other threads. Thread-local variables are declared with threadvar instead of var. For example, cannot occur within a procedure or function. cannot include initializations. cannot specify the absolute directive. Dynamic variables that are ordinarily managed by the...

Introduction to the ECO Framework

Borland's approach to design driven application development is that models should be implemented and then executed, rather than interpreted by the developer. The difference between implementation and interpretation is that a precisely described model contains enough information that much of the source code needed to bring the model to life can be generated automatically, as opposed to being written by hand. Developers can now work at the level of the model, in the familiar context of Delphi...

Class Methods

A class method is a method (other than a constructor) that operates on classes instead of objects. The definition of a class method must begin with the reserved word class. For example, class function Supports(Operation string) Boolean virtual class procedure GetInfo(var Info TFigureInfo) virtual The defining declaration of a class method must also begin with class. For example, class procedure TFigure.GetInfo(var Info TFigurelnfo) begin In the defining declaration of a class method, the...

Logical Bitwise Operators

The following logical operators perform bitwise manipulation on integer operands. For example, if the value stored in X (in binary) is 001101 and the value stored in y is 100001, the statement assigns the value 101101 to z. Logical (Bitwise) Operators assigns the value 101101 to z. Logical (Bitwise) Operators The following rules apply to bitwise operators. The result of a not operation is of the same type as the operand. If the operands of an and, or, or xor operation are both integers, the...

Welcome Page

When you open Delphi 8 for .NET, the Welcome Page appears with a number of options and links to select from. As you develop a project or multiple projects, a table displays your most recent projects and a timestamp of when each project was modified. This provides quick access to your most recent projects. If you close the Welcome Page, you can reopen it by choosing View Welcome Page. The Welcome Page contains buttons to access and open projects. You can also access the latest online Help...

Creating New Reports in Delphi for NET

You can include reports in Delphi 8 for .NET just as you would other 3rd-party components. The report is stored as a separate Rave Report object. You can reference the report in any number of applications that have a need to call or generate that report. When you create a new application, you can include the report object by adding a reference to it in the Project Manager. Rave Reports also provide the capability to connect your report object to a datasource, which allows the report to be built...

Interop Assemblies and the Project Manager

Interop assemblies (including ActiveX Control wrapper assemblies) generated by the IDE are kept in a separate folder called COMImports, underneath your project. Each generated assembly will have its 'Copy Local' property set, meaning that when the project is built, the assembly will be copied to the folder where the final build target of the project is kept. The exceptions to this rule are primary interop assemblies, which are deployed in the GAC. When you add a reference to a primary interop...

Calling Conventions

When you declare a procedure or function, you can specify a calling convention using one of the directives register, pascal, cdecl, stdcall, and safecall. For example, function MyFunction(X, Y Real) Real cdecl Calling conventions determine the order in which parameters are passed to the routine. They also affect the removal of parameters from the stack, the use of registers for passing parameters, and error and exception handling. The default calling convention is register. The register and...

To set the Namespace property for a dataset

In the Project Manager, double-click the .xsd file that contains the XML definition of your dataset. 2. Find the targetNamespace property. 4. If you have the program code file (< dataset> .pas) open in the Code Editor, close it now. 5- Choose Project Compile to recompile the .xsd file. If you re-open the program code file, you will see that the InitClassO class now contains the new namespace.

To add and configure a connection handle

Scroll the Tool Palette so that the Borland Data Provider category is in view. Note If you are using a SQL Server persistence handle, scroll to the Data components category. 2. Drag a BdpConnection (or SqlConnection) component onto the ECO Space designer surface. 3. Select the persistence mapper component on the designer surface. 4. Set the Connection property of the persistence mapper component to the connection handle you created in step 2. 5. Set the default vendor-specific configuration...

Data Providers

Data Provider components connect to the physical databases or XML files, hiding implementation details. Providers can connect to one or more data sources, pass commands, and expose data to the DataSet. The .NET Framework includes providers for MS SQL, OLE DB, and Oracle. In addition to supporting the .NET providers, this product includes Borland Data Providers for .NET. BDP.NET connects to a number of industry standard databases, providing a consistent programming environment. For more...

To add event handlers for the New child and Close All commands

If necessary, open the Menu designer and select New child. 2. In the Object Inspector, double-click the OnClick event on the Events tab. The Code editor displays with the cursor in the TfrMain.mnNewChildclick event handler block. 3. At the cursor, enter the following code CreateChildForm('Child '+IntToStr(MDIChildCount+1)) 4. In the Menu designer, select Close All. 5. In the Object Inspector, double-click the OnClick event on the Events tab. The Code editor displays with the cursor in the...

Configuring the Source Control System

Configuring Delphi 8 for .NET and your source control system to interact is a simple task. First, install and configure your source control system itself. If you are an individual developer or in a small shop, you might be required to perform this task yourself. Otherwise, if you are in a large, distributed environment, it is likely that your system administrator or project manager handles this task. In any case, refer to the documentation for your particular source control system to perform...

Enumerated Types with Explicitly Assigned Ordinality

By default, the ordinalities of enumerated values start from 0 and follow the sequence in which their identifiers are listed in the type declaration. You can override this by explicitly assigning ordinalities to some or all of the values in the declaration. To assign an ordinality to a value, follow its identifier with constantExpression, where constantExpression is a constant expression that evaluates to an integer. For example, type size (small 5, Medium 10, Large small + Medium) defines a...

To set a breakpoint

Click the left gutter of the Code Editor next to the line of code where you want to pause execution. 2- To add a breakpoint and set options for the breakpoint, choose Run Add Breakpoint Source Breakpoint to display the Add Source Breakpoint dialog box. Tip To widen the Code Editor gutter, choose Tools Options Editor Options P-Display and increase the Gutter width option. The following icons are used to represent breakpoints in the Code Editor gutter. The breakpoint is valid and enabled. The...

Automated Members Win Only

Automated members have the same visibility as public members. The difference is that Automation type information (required for Automation servers) is generated for automated members. Automated members typically appear only in Win32 classes, and the automated reserved word has been deprecated in the .NET compiler. The automated reserved word is maintained for backward compatibility. The TAutoObject class in the ComObj unit does not use automated. The following restrictions apply to methods and...

To modify the structure of the dataset

In the Project Manager, double-click the .xsd file that contains the XML definition of your dataset. 2. Edit the XML file to reflect how you want the dataset to be structured. You can change data types, names, and anything else about the structure. 3. If you have the program code file (< dataset> .pas) open in the Code Editor, close it now. 4- Choose Project Compile to recompile the .xsd file. If you re-open the program code file, you will see that the file contains the changes you made to...

Using the ECO Space Designer

An ECO Space is a container for the runtime instances of the classes in your model. The ECO Space designer lets you select UML packages from your model, choose the persistence mechanism for objects, create or evolve the database schema, and perform designtime validation of the model. You cannot work directly with the class Borland.Eco.Handles.EcoSpace. Instead, the IDE automatically creates a subclass of the EcoSpace class for you, when you create a new ECO application. If you have imported a...

To create the main menu and commands

From the Standard page on the Components palette, place a MainMenu component on the main form. 2. Double-click the MainMenu component. The Menu designer (frMain.MainMenu1) displays with the first blank menu item highlighted. 3. In the Object Inspector on the Properties tab, enter mnFile for the Name property and & File for the Caption property then press ENTER. In the Menu designer, File displays as the name of the first menu item. 4. In the Menu designer, select File. A blank command field...

Null Terminated String Functions

The following functions are provided for handling null-terminated strings. Null-terminated string functions Allocates a character buffer of a given size on the heap. Returns the size of a character buffer allocated using StrAlloc or StrNew. Disposes a character buffer allocated using StrAlloc or StrNew. Copies a string and returns a pointer to the end of the string. Returns a pointer to the end of a string. Formats one or more values into a string. Compares two strings without case sensitivity....

Satellite Assembly Wizard

You can make your application adapt to the locale of the system it is running on, simply by providing the appropriate satellite assemblies. Satellite assemblies are used to deploy language-specific resources for an application.When your application starts up, it checks the locale of the local system. If it finds any satellite assemblies with the same name as the EXE, assembly, or package files it is using, it checks the extension on those assemblies. If the extension of the resource module...

To deploy an ECO application

1- Open your project and select View Project Manager to display the Project Manager window if it is not already open. 2. Select the appropriate compiler settings in the Project Options dialog box. Note You must set the appropriate build settings on each project in your application's project group. 3- Select Project Build < Project Name> where < Project Name> is the actual name of your project to build your application. The build targets for each project in your application's project...

The Model View Window

Unlike the Project Manager, the Model View window lets you navigate your project based on the logical relationships between the classes and other elements in source code. The Model View window actually presents these relationships from two very different perspectives code visualization, which derives a UML class diagram from arbitrary Delphi code, and visualization of ECO-enabled packages and classes. Code visualization scans source code and derives the elements, such as namespaces and classes,...

To Add an ECO Enabled Windows Form to Your Project

1- Click on File New Other to open the New Items dialog box. 2. Select the ECO Delphi for .NET Files category. 3. Double-click the ECO Enabled Windows Form icon. The ECO Enabled Windows Form Wizard generates a new subclass of System.Windows. Forms.Form. The new class provides a constructor that is passed an instance of the application's ECO Space. The constructor then uses this instance to initialize the form's ECO Space property. An ECO enabled form also provides fields to hold a root handle,...

To create a strongly typed Data Set

From the Database Explorer, select the data source you want to use. 2. Drag and drop the name of the database table you want to use onto your form. This displays a BdpConnection icon and a BdpDataAdapter icon in the Component Tray. 4. Click the Configure Data Adapter designer verb in the Designer Verb area beneath the Object Inspector. This displays the Data Adapter Configuration dialog. 5. Modify the pre-filled SQL statement if you like. Note Do not create a DataSet by selecting the DataSet...

Data Set

The DataSet object represents in-memory tables and relations from one or more data sources. The DataSet provides a temporary work area or virtual scratch pad for manipulating data. ADO.NET applications manipulate tables in memory, not within the physical database. The DataSet provides additional flexibility over direct connections to physical databases. Much like a typical cursor object supported by many database systems, the DataSet can contain multiple DataTables, which are representations of...

Copy References to a Local Path

During runtime, assemblies must be in the output path of the project or in the Global Assembly Cache (GAC) for deployment. In the Project Manager, you can right-click an assembly and use the Copy Local setting to copy the reference to the local output path. Follow these guidelines to determine whether a reference must be copied. If the reference is to an assembly created in another project, select the Copy Local setting. If the assembly is in the GAC, do not select the Copy Local setting.

Creating a VCL Forms ActiveX Active Form

Like a Delphi control, an ActiveX control generates program code when you place the component on a form or other logical container in the IDE. The main difference between an ActiveX control and a Delphi control is that an ActiveX control is language independent. You can create ActiveX controls for deployment to a variety of programming environments on Windows, not just Delphi or C Builder, for example. This procedure uses the VCL forms ActiveX Active Form wizard to create an Active Form...

Deploying a NET Component to the Global Assembly Cache

The .NET Framework SDK utility called gacutil is a command-line program that is used to install, remove, and view components in the GAC. The gacutil command is usable from installation scripts as well as from batch files. The gacutil command supports installation and removal of shared assemblies, with and without the use of reference counting. It is recommended that the non-reference counted command switches be used only during development. Installation scripts that use gacutil to install...

Using COM Interfaces

When using COM interfaces, a similar approach is taken as when using unmanaged API's. The interface needs to be declared, using custom attributes to describe the type interface and the GUID. Next the methods are declared using the same approach as for unmanaged API's. The following example uses the IAutoComplete interface, defined as follows in Delphi 7 function Init hwndEdit HWND punkACL IUnknown pwszRegKeyPath LPCWSTR pwszQuickComplete LPCWSTR HRESULT stdcall function Enable fEnable BOOL...

To create an empty Interbase database using the IBConsole program

Start the Interbase Console program, IBConsole. 2. Login to the server where you want the new database to be created. Under the Databases node you will see a list of databases that reside on that server. 3. Right-click on the Databases node, and select Create Database. 4. Type the path and file name of the database. Customize any database parameters you wish to change, and click OK. The new database will be displayed under the Databases node in the IBConsole window. Next, you must go back to...

To use the Data Adapter Preview

After you have dropped a BdpDataAdapter component onto the designer, click the Configure Data Adapter designer verb that appears at the bottom of the Object Inspector. 2. Click the Preview tab to display the Data Adapter Preview. 3. To limit the number of rows fetched, click the Limit rows check box. 4. Enter the number of rows you want the result set to contain, in the Rows to fetch text box. 5. Click Refresh to re-execute the query and to refill the list box with the new number of rows.

Nested Exceptions

Code executed in an exception handler can itself raise and handle exceptions. As long as these exceptions are also handled within the exception handler, they do not affect the original exception. However, once an exception raised in an exception handler propagates beyond that handler, the original exception is lost. This is illustrated by the Tan function below. ETrigError class EMathError function Tan X Extended Extended begin try raise ETrigError.Create 'Invalid argument to Tan' end end If an...

To create a database project from the Data Explorer

Make sure you have a live connection to a database. 2. From the View menu, select Data Explorer. 3- Choose File New Other and select a Delphi for .NET project. 4. Expand the Data Explorer Tree by drilling down to the Table or View level. 5. Drag and drop any data onto your form. All the appropriate database components, including bdpConnection, bdpCommand, and bdpDataAdapter, appear in the component tray. 6. Specify the appropriate database properties for each database component, for...

To define primary keys for each Data Table in the Data Set

Select each data adapter in turn and set the Active property under Live Data in the Object Inspector to True. 2. Select the DataSet in the Component Tray. 3. In the Object Inspector, in the Tables property, click the ellipsis button. This displays the Tables Collection Editor. If you have set all of the data adapters' Active properties to True, the Tables Collection Editor will contain one member for each DataTable stored in the corresponding DataSet. 4. Select a table from the members list....

Using Action Manager to Create Actions in a VCL Forms Application

Using Delphi 8 for .NET, the following procedure illustrates how to create actions using ActionManager. It sets up a simple user interface with a text area, as would be appropriate for a text editing application, and describes how to create a file menu item with a file open action. Building the VCL application with ActionManager actions consists of the following major steps 2. Add a file open action to the ActionManager. 5. Build and run the application.

Compound Statements

A compound statement is a sequence of other simple or structured statements to be executed in the order in which they are written. The compound statement is bracketed by the reserved words begin and end, and its constituent statements are separated by semicolons. For example The last semicolon before end is optional. So we could have written this as Compound statements are essential in contexts where Delphi syntax requires a single statement. In addition to program, function, and procedure...

BorlandVCL Namespace

VCL.NET classes are found under the Borland.Vcl namespace. Database-related classes are in the Borland.Vcl.DB namespace. Runtime library classes are in the Borland.Vcl.Rtl namespace. If you are a user of earlier Delphi versions, you will find that the unit files with which you are familiar, have been bundled in corresponding Borland.Vcl namespaces. In some cases, units have been moved, however, every attempt has been made to identify the namespaces in meaningful ways, and in ways that will...

Add Web Reference

You can add a Web Reference to your client application to access Web Services applications. A Web Reference refers to either a WSDL document or an XML schema, which is imported into your client application. The WSDL document or XML schema describes a Web Service application. When you import one of these documents, Delphi 8 for .NET generates the interfaces and class definitions needed for calling that Web Service application. Right-click the WebService node in the Project Manager and select Add...

Configuring the IDE to avoid internal errors

Create a single directory where all of your .dcpil files precompiled package files are placed. For example, create a directory called C DCPIL and under ToolsEnvironment Options select the Library tab and set the DCPIL output directory to C DCPIL. This setting will help ensure that the .dcpil files the compiler generates are always up-to-date which is particularly useful when you move a package from one directory to another. You can create a .dcuil directory on a per-project basis using...

To connect a Data Grid to a Data Set

Drag and drop a DataGrid component onto the designer. If necessary, select DataGrid. 2. In Object Inspector, select the DataSource property drop-down. Select the DataSet component that you generated previously the default is DataSet1 . 3. In Object Inspector, select the DataMember property drop-down. Select the appropriate table. The DataGrid displays data from the DataSet. The application compiles and displays a Windows Form with DataGrid. While presenting a minimum number of steps required...

Pascal cdecl stdcall and safecall Conventions

Under the pascal, cdecl, stdcall and safecall conventions, all parameters are passed on the stack. Under the pascal convention, parameters are pushed in the order of their declaration left-to-right , so that the first parameter ends up at the highest address and the last parameter ends up at the lowest address. Under the cdecl, stdcall, and safecall conventions, parameters are pushed in reverse order of declaration right-to-left , so that the first parameter ends up at the lowest address and...

To change the value of an expression

Specify the expression in the Expression edit box. To modify a component property, specify the property name, for example, this. 3. Enter a value in the New Value edit box. The expression must evaluate to a result that is assignment-compatible with the variable you want to assign it to. Typically, if the assignment would cause a compile or runtime error, it is not a legal modification value. 4. Choose Modify. The new value is displayed in the Result box. You cannot undo a change to a...

To add a file open action to Action Manager

From the Additional page of the Tool palette, add an ActionManager component to the form. 2. Double-click ActionManager to display the Action Manager editor. Tip To display captions for nonvisual components such as ActionManager, choose Tools Environment Options. On the Designer tab, check Show component captions, and click OK. 3. If necessary, click the Actions tab. 4. Select New Standard Action from the drop-down list to display the Standard Action Classes dialog. 5. Scroll to the File...

Declaring a Custom Attribute Class

Creating a custom attribute is the same as declaring a class. The custom attribute class has a constructor, and properties to set and retrieve its state data. Custom attributes must inherit from TCustomAttribute. The following code declares a custom attribute with a constructor and two properties TCustomCodeAttribute class TCustomAttribute private Fpropl integer Fprop2 integer aVal integer procedure Setprop1 p1 integer procedure Setprop2 p2 integer public constructor Create const myVal integer...

Data Types

The following table shows commonly used data types, and how to translate them for managed code of Byte array a b of Bytearray a b of Byte When working with arrays and strings in structures, the MarshalAs attribute is used to describe additional information to the default marshaler about the data type. A record declared in Delphi 7, for example IntBuffer array 0 31 of Integer CharBuffer array 0 127 of Char lpszInput LPTSTR lpszOutput LPTSTR end Would be declared as follows in Delphi 8 for .NET...

To enable or disable a breakpoint or breakpoint group

Right-click the breakpoint icon in the Code Editor or in the Breakpoint List window and choose Enabled to toggle between enabled and disabled. 2. To enable or disable all breakpoints, right-click a blank area not on a breakpoint in the Breakpoint List window and choose Enable All or Disable All. 3. To enable or disable a breakpoint group, right-click a blank area not on a breakpoint in the Breakpoint List window and choose Enable Group or Disable Group. Disabling a breakpoint or breakpoint...

Scope

An identifier, such as a variable or function name, can be used only within the scope of its declaration. The location of a declaration determines its scope. An identifier declared within the declaration of a program, function, or procedure has a scope limited to the block in which it is declared. An identifier declared in the interface section of a unit has a scope that includes any other units or programs that use the unit where the declaration occurs. Identifiers with narrower scope,...

Reraising Exceptions

When the reserved word raise occurs in an exception block without an object reference following it, it raises whatever exception is handled by the block. This allows an exception handler to respond to an error in a limited way and then re-raise the exception. Re-raising is useful when a procedure or function has to clean up after an exception occurs but cannot fully handle the exception. For example, the GetFileList function allocates a TStringList object and fills it with file names matching a...

Dynamic Arrays

Dynamic arrays do not have a fixed size or length. Instead, memory for a dynamic array is reallocated when you assign a value to the array or pass it to the SetLength procedure. Dynamic-array types are denoted by constructions of the form declares a one-dimensional dynamic array of reals. The declaration does not allocate memory for MyFlexibleArray. To create the array in memory, call SetLength. For example, given the previous declaration, allocates an array of 20 reals, indexed 0 to 19....

To add code to the button Click event

Double-click the button to open the Code Editor. 2. In the button1_Click event code block, add the following code This closes the command to make sure that we will pass the parameter to the most current bdpSelectCommand. Self.BdpDataAdapter1.Active false This clears the data adapter so that we don't maintain old data textBoxl. This sets the parameter value to whatever value is in the text field. Self.BdpDataAdapterl.Active true This re-activates the data adapter so the refreshed data appears...

To add a parameter to the data adapter

Select the data adapter icon, then expand the properties under SelectCommand in the Fill area of the Object Inspector. You should be able to see your Select statement in the SelectCommand property drop down list box. 2. Change the ParameterCount property to 1. 3. Click the Collection entry next to the Parameters property. This displays the BdpParameter Collection Editor. 4. Click Add to add a new parameter. 5. Rename the parameter to emp. 6. Set BdpType to String, DbType to Object, Direction...

To create a data adapter and connection

1 Choose File New Application where Application is the language type you are using. 2. Click on the Data Explorer tab and drill down to find the IBConn1 connection under the Interbase node. 3. Drag and drop the EMPLOYEE table onto the Windows Form. This creates a BdpDataAdapter and BdpConnection and displays their icons in the Component Tray. 4. Select the data adapter icon, then click the Configure Data Adapter designer verb in the Designer Verb area at the bottom of the Object Inspector. This...

To configure an ECO Space using the designer

Select the UML packages containing the classes that you want to be persistent. 2. Choose a persistence method, either an RDBMS, or XML file. Here you will add the required persistence components to the ECO Space, and then configure the ECO Space to use the chosen persistence method by setting properties in the Object Inspector. 3. Validate the Model. This will cause the IDE to perform a number of checks to make sure the model is well-formed. For example, OCL expressions are checked to make...

The Relationship between Vclnet and the NET Framework

It's important to understand the relationship between VCL.NET and the .NET Framework. The .NET Framework provides a library of components, classes, and low-level functionality that supports a more transparent type of application development, particularly for Web applications. The concept of transparency, in this context, means that the framework manages much of the common functionality, from the display of buttons to remoting functionality, without regard to the underlying implementation...

Using Rave Reports ActiveX Components

You can drag-and-drop any ActiveX objects that are exposed by Rave Reports to your applications. The Delphi 8 for .NET tool palette provides a list of any available ActiveX objects. Just drag-and-drop the objects you want onto a Windows Form or a Web Form during design. Fill in the appropriate properties and modify any code in the Code Editor. You may need to reset your .NET components and to select the ActiveX components you want displayed, by selecting them from the Installed .NET Components...

To display child node contents in the XML file

In the Object Inspector with Button1 selected, double-click the OnClick event on the Events tab. The Code displays with the cursor in the TForml.Buttonlciick event handler block. 2. Enter the following code to display the stock price for the first child node when the Borland button is clicked Price BorlandStock.ChildNodes 'price' .Text Memol.Text Price 3. Add a var section just above the code block in the event handler, and enter the following local variable declarations BorlandStock...

To get a resource string from the Translation Repository

In the Translation Manager, click the Workspace tab. 2. Expand the project tree view to display the resource files that you want to edit. The .resx files are listed under the .NET Resources node. The .nfm files are listed under the Forms node. 3. Click the resource file you want to edit. The resource strings in the file are displayed in a grid in the right pane. 4- Right-click the field that you want to update and choose Repository Get strings from repository. If the Translation Repository...

For Statements

A for statement, unlike a repeat or while statement, requires you to specify explicitly the number of iterations you want the loop to go through. The syntax of a for statement is forcounter initialValuetofinalValuedostatement forcounter initialValuedowntofinalValuedostatement where counter is a local variable declared in the block containing the for statement of ordinal type, without any qualifiers. initialValue and finalValue are expressions that are assignment-compatible with counter....

To add multiple tables to one Data Set

From the Data Explorer, select a data source. 2. Drill down in the tree, then drag and drop the names of multiple tables, one at a time, onto your Windows Form or Web Form. This creates the BdpDataAdapter for each table and one BdpConnection for that data source and displays icons for those objects in the Component Tray. 3. Click the BdpDataAdapter icon named bdpDataAdapter1, by default to select it. 4. Click the Configure Data Adapter designer verb in the Designer Verb area at the bottom of...

Redistributing Delphi for NET Files

When building applications that use the VCL .NET framework, the way you build the application determines what files you need to distribute with it. If you build the application by compiling VCL for .NET units directly into the program executable file, the application will have external dependencies only on the .NET Framework. However, if you build the application by compiling the application to have external references to VCL for .NET assemblies, the application will have external dependencies...

To use the multiread exclusivewrite synchronizer

Create a global instance of TMultiReadExcllusiveWriteSynchronizer that is associated with the global memory you want to protect. 2. Before any thread reads from the memory, it must call BeginRead. 3. At the completion of reading memory, the thread must call EndRead. 4. Before any thread writes to the memory, it must call BeginWrite. 5. At the completion of writing to the memory, the thread must call EndWrite. Warning The multi-read exclusive-write synchronizer only works if every thread uses...

To Inspect a Windows Type Library

In the Open dialog box, open the Files of type drop-down list, and Type Library. This will set the file filter to display files with extensions of .TLB, .OLB, .OCX, .DLL, and .EXE. 3. Navigate to the folder where the type library is located. Select the file and click Open. You can open multiple type libraries in the explorer. Each open type library is displayed in the tree in the left-pane the top-level node for a type library is denoted by the icon. To...

Setting Up the External Translation Manager

If you are localizing an application and do not have the Delphi 8 for .NET IDE, you can use the External Translation Manager ETM to perform the translations. The ETM provides the same basic functionality as the Translation Manager in the product. To use the ETM, the developer must provide you with the required ETM and project files. After you have finished the translations, you can send the translated files back to the developer to add to the project. The basic steps to set up the ETM are 1....

To create an association between two classes

Select Association as the type of element in the Tool Palette. 2. Move the mouse cursor over one of the classes to participate in the association. The class will be highlighted with a rectangle. 3. Click the mouse within the highlighted class and then move the mouse to the class at the other end of the association. 4. Again, the class will be highlighted with a rectangle. Click the mouse over the highlighted class. An association will be drawn between the two classes. Select the association,...

To set a dynamic property in the Object Inspector

In a form on the Design tab, click the object for which you want to set dynamic properties. 2. In the Object Inspector, expand DynamicProperties and click Advanced . If the object does not support dynamic properties, DynamicProperties is not displayed. Tip If the Object Inspector is arranged by category, DynamicProperties is displayed under Configurations. 3. Click the ellipsis button next to Advanced to display the Dynamic Properties dialog box. This dialog lists all of the properties that...

To import a model in XMI format

Export the model from the modeling tool, using the XMI format. When exporting from Rational Rose, choose XMI version 1.1, using the Unisys extension. 2- In Delphi 8 for .NET, start a new ECO application by selecting File New Other, and choosing ECO Application from the New Items dialog box. 3. Open the Model View Window, and right-click on the top-level project node in the tree. Choose Import Project from XMI. 4. In the XMI Import dialog box, click the Browse button to navigate to the XMI...

To wait for a task to complete

Create a TEvent object of global scope. 2. When a thread completes an operation other threads are waiting for, have the thread call TEvent. 3. To turn off the signal, call TEvent.ResetEvent. The following example is an OnTerminate event handler that uses a global counter in a critical section to keep track of the number of terminating threads. When Counter reaches 0, the handler calls the SetEvent method to signal that all processes have terminated procedure TDataModule.TaskTerminateThread...

Numeric Constants

Numeric constants must be integers, and their values must be between 2,147,483,648 and 4,294,967,295. By default, numeric constants use decimal notation, but the built-in assembler also supports binary, octal, and hexadecimal. Binary notation is selected by writing a B after the number, octal notation by writing an O after the number, and hexadecimal notation by writing an H after the number or a before the number. Numeric constants must start with one of the digits 0 through 9 or the...

To create a new package for the ActiveX button

1- Choose File New Other to create a new package. The New Items dialog displays. 2. Double-click Package on the New page to display the Package - package.dpk dialog and click Add. 3. On the Add unit tab of the Add dialog, browse to your project directory. 4. Select the ButtonXControll_TLB.pas file, and click Open. 5. Click OK to add the file to the package and return to the Package - package.dpk dialog. The Package - package.dpk dialog displays showing the files in the package and two required...

Configure Data Adapter

Delphi 8 for .NET provides a Configure Data Adapter designer which lets you configure SQL statements or stored procedures that are invoked to read or write to a database. Data Adapters are an integral part of the ADO.NET managed providers, which are a set of objects used to communicate between a data source and a dataset. Essentially, Adapters are used to exchange data between a data source and a dataset. This means reading data from a database into a dataset, and then writing changed data from...

Variant Arrays

You cannot assign an ordinary static array to a variant. Instead, create a variant array by calling either of the standard functions VarArrayCreate or VarArrayOf. For example, V VarArrayCreate 0,9 , varlnteger creates a variant array of integers of length 10 and assigns it to the variant v. The array can be indexed using v 0 , v 1 , and so forth, but it is not possible to pass a variant array element as a var parameter. Variant arrays are always indexed with integers. The second parameter in...

Advanced techniques

The use of a GCHandle, although relatively easy, is fairly expensive in terms of performance. It also has the possibility of resource leaks if handles aren't freed correctly. If object references are maintained in the managed code, it is possible to pass a unique index, for example the hash code returned by the GetHashCode method, to the unmanaged API instead of an object reference. A hash table can be maintained on the managed side to facilitate retrieving an object instance from a hash value...

To create an Active X library project for an ActiveX Active Form

Create a directory on your local drive for the ActiveX project. Give it an easy to find name, for example, ActiveX. 2. Create a second directory to contain the ActiveX component and an HTML file for deploying the Active Form to your Microsoft Internet Explorer Web browser. Name this directory ActiveX_Deploy. 3. Choose FileNewOther and select the ActiveX page in the New Items dialog. 4. On the ActiveX page, double-click Active Form. The Active Form Wizard displays. 5. Accept the default...

Building Vclnet Applications

VCL.NET gives you the capability to provide your Delphi VCL applications and components to Microsoft . NET Framework users. VCL.NET is an extended set of the VCL components that provide the means to quickly and easily build advanced applications in Delphi. Now, with Delphi 8 for .NET you get all of the benefits of the .NET Framework along with the ease-of-use and powerful component-driven application development you've come to expect from Delphi. Delphi 8 for .NET provides distinct application...

Ole Variant

The OleVariant type exists on both the Windows and Linux platforms. The main difference between Variant and OleVariant is that Variant can contain data types that only the current application knows what to do with. OleVariant can only contain the data types defined as compatible with OLE Automation which means that the data types that can be passed between programs or across the network without worrying about whether the other end will know how to handle the data. When you assign a Variant that...

Adonet Application Deployment

When building database applications using Delphi 8 for .NET, copy the necessary files assemblies and DLLs for deployment to a specified location. The following table lists the name of the assemblies and DLLs and the location of where each assembly should reside. For specific database runtime assemblies, copy them to the following location For database DLLs, copy them to the following location

Exceptions and Runtime Errors in Libraries

When an exception is raised but not handled in a dynamically loadable library, it propagates out of the library to the caller. If the calling application or library is itself written in Delphi, the exception can be handled through a normal try...except statement. On Win32, if the calling application or library is written in another language, the exception can be handled as an operating-system exception with the exception code 0eedfade. The first entry in the ExceptionInformation array of the...

Array Constants

To declare an array constant, enclose the values of the array s elements, separated by commas, in parentheses at the end of the declaration. These values must be represented by constant expressions. For example, const Digits array 0..9 of Char 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 declares a typed constant called Digits that holds an array of characters. Zero-based character arrays often represent null-terminated strings, and for this reason string constants can be used to initialize character...

IBX components

The following components are located on the InterBase tab of the component palette. Though they are similar to BDE components in name, the IBX components are somewhat different. For each component with a BDE counterpart, the sections below give a discussion of these differences. There is no simple migration from BDE to IBX applications. Generally, you must replace BDE components with the comparable IBX components, and then recompile your applications. However, the speed you gain, along with the...