Title: From Win32 To .NET Programming With Delphi
1From Win32 To .NET Programming With Delphi
2Agenda
- ? Win32 ? Object Pascal ? ? ? ? ? .NET ? Delphi ?
? ? ? - ? ? Delphi ? ? ? ? ? ? ? .NET
- DLL/COM/COM/ActiveX ? ? ? .NET ? ?
- Delphi ? ? ? .NET ? ?
- VCL Framework ? VCL .NET
- Delphi ? ? ? ? ? ? ? ? ? ? ? ? .NET ? ? ? ? ? ? ?
- QA
3Borland Delphi
- Large and loyal independent developer community
- Estimated 1 million developers world wide
- 50 of the BDN community (1.6m registrations)
- 580 registered component developers
- Strong solution for SME, Departmental, and ISV
Applications
4Delphi Technology Innovation
ALM/.NET
Future Technology
ALM/.NET
ALM / .NET
Web Services
Web Services
Intranet/Internet
Multi-tier
Multi-tier
Client/Server
Database
Windows/desktop
5Delphi Technology Foundation
Application Lifecycle Management
Design Driven Development
Future
Strategic
Delphi IDE
Delphi Compiler .NET
Delphi Compiler Win32
Language
VCL.NET
VCL
Winforms
WebForms
API
.NET
Win32
Platform
6What the Analysts Say
Delphi developers should pay careful attention
to the delivery of Borlands new .NET IDE before
any transition to Visual Studio .NET it has the
potential to better meet the needs of developers
leveraging .NET in a multi-vendor, best-of-breed
environment.Mark Driver, Research Analyst,
Gartner Group
7Project Octane
- Delphi for Win32 and .NET
8Project Octane for Win32 and .NET
- Accelerate the Delphi Application Lifecycle for
Win32 and .NET - Address the needs of Delphi developers on Windows
and those moving to .NET - Increase productivity with Design Driven
development - Interoperability with Mixed environments
9Microsoft Platform Evolution
Delphi 1
Delphi 2
Octane
Win16
Win32
.NET
x86
x86
Managed Code
- Delphi supports the Windows ? .NET evolution
- Managed code, Optimized for Windows
- The new API for Windows, the Windows Platform
Standard - .NET adoption, Not if but when
10Borland Commitment to Windows and .NET
02/02 Borland announces support for Microsoft .NET
08/02 Delphi 7 Studio and the Borland Preview for Microsoft .NET shipped
10/02 Borland joins .NET Advisory Council
12/02 .NET SDK redistribution agreement signed
02/03 Borland announces Optimizeit Profiler for the Microsoft .NET Framework
04/03 Borland Platinum sponsor at Microsoft Windows Server 2003 launch event
04/03 Borland announces ALM for .NET strategy
05/03 Borland announces CBuilder for the Microsoft .NET Framework and Borland Janeva
11.NET Support
- Reuse Delphi language skills with the Microsoft
.NET Framework - DCCIL compiler is first class .NET citizen
generating 100 .NET code - Build new .NET applications using the Delphi
language - Migrate existing Delphi applications to .NET
- VCL.NET is 100 .NET compliant component library
with a high degree of VCL compatibility - Reuse existing code
- Single environment for Delphi and C development
- Octane IDE will interoperate with CBuilder IDE
(or vice-versa) - Enables Delphi developers to add C to their
projects and skills
12Application Lifecycle Management Solution for
Octane
Easily check Octane source files in and out of
StarTeam repository through Octanes built-in
LiveTeam features
Win32 and .NET modeling tool integration.
Integrated UML Designer
Project Octane
Design
CaliberRM
Conveniently profile any Octane .NET assembly or
executable in your project from within Octane
Monitor Octane project requirements progress via
the CaliberRM status pane within Octane
Microsoft Windows .NETServer
13From Now On Only Pure Tech.
Are You Ready?
Dont Fall Asleep!
14? Win32 ? Object Pascal ? ? ? ? ? .NET ? Delphi ?
? ? ?
- Object Pascal????????.NET?, ?????.NET
CLR/CLS??????????? - Object Pascal???????, ??.NET CLR/CLS??,
????Delphi?? - DFM????Persistent????Delphi????????.PAS???
15Data Type Mapping
16Data Type Mapping
- Extended ? System.Double???8-byte floating-point
type - Char??2???
- String??WideString
17(No Transcript)
18New Improved
- Unit Namespaces
- Qualified Identifiers
- Nested Types
- Custom Attributes
- Class (static) data
- Class properties
- Class static methods
- Records w/ Inheritance
- Records w/ methods
- Sealed classes
- Final methods
- Multicast Events
- Include/Exclude events
- Array prop overloads
- Boxing into objects
19Unit Namespaces
- Access units with fully qualified idents
- Uses Borland.VCL.Forms
- Delphi unit defines its own namespace
- Dotted names in unit identifiers and file names
- Project namespace search path
- Search for unqualified unit names on namespace
path - Uses Forms
- In VCL project, Forms -gt Borland.VCL.Forms
- In CLX project, Forms-gt Borland.CLX.Forms
- Project default namespace
20Project Namespaces
- Eliminate uses clause IFDEFs
- Project namespace search path
- Search for unqualified unit names on namespace
path - Uses Forms
- In VCL project, Forms -gt Borland.VCL.Forms
- In CLX project, Forms-gt Borland.CLX.Forms
- Project default namespace
- Unit MyControl
- VCL project compiles to Borland.VCL.MyControl.DCU
- CLX project compiles to Borland.CLX.MyControl.DCU
21Using Attributes
- type FooAttribute(Hello, 23) TMyClass
class SpecialDataAttribute Fdata
Integer WebMethod, DebuggerStepThrough
function SampleCount Byteend
22????
Delphi??(.dpr)
Delphi????(.dfm)
.NET????
DFM2PAS
Delphi.NET??(.dpr)
Delphi.NET Compiler dccil
Delphi.NET ????(.pas)
23A Win32 Sample Program
24??DFM2PAS/Dccil
- Dfm2pas PWin32Prg.dpr PNetPrg.dpr
- ??PWin32Prg.dpr
- dfm2pas fmMain.pas fmNetMain.pas
- Dccil v PNetPrg.dpr
25A Object Pascal/Delphi Language Sample Program
- TForm1 class(TForm)
- Button1 TButton
- Button2 TButton
- procedure Button1Click(Sender TObject)
- private
- Private declarations
- class var
- iX Integer
- iY Integer
- class function GetX Integer static
- class procedure WriteX(const iValue
Integer) static - public
- Public declarations
- class function GetSystemTime String
static - class property X Integer read GetX write
WriteX - end
26A Object Pascal/Delphi Language Sample Program
- class function TForm1.GetX Integer
- begin
- Result TForm1.iX
- end
- class procedure TForm1.WriteX(const iValue
Integer) - begin
- if (iValue ltgt TForm1.iX) then
- TForm1.iX iValue
- end
- procedure TForm1.Button1Click(Sender TObject)
- begin
- Button1.Caption TForm1.GetSystemTime
- TForm1.X 999
- Button2.Caption IntToStr(TForm1.X)
- end
27? ? Delphi ? ? ? ? ? ? ? .NET
- ????Dfm2Pas/Dccil????????????
- ???Delphi 8?IDE???Compile??
- ????????Delphi??,???????CLR/CLS????
- ??Win32 API??????.NET?InterOp??
28DLL/COM/COM/ActiveX ? ? ? .NET ? ?
29DLL/COM/COM/ActiveX ? ? ? .NET ? ?
- A DLL Demo
- ??DllImport Attribute
- //DllImport('aviPlayer.dll', CharSetCharSet.Ansi
, EntryPoint 'PlayAVI') - //procedure PlayAVI(const sName String)
external
30DLL/COM/COM/ActiveX ? ? ? .NET ? ?
31A COM Demo
- function TdDemoCOM.GetSystemInfo WideString
- begin
- Result 'This is COM Object Right now is '
DateToStr(now) - end
32Demo Process
- Step 1??COM??Type Library wrapper Assembly
- Tlbimp PDemoCOM.dll /outPNETDemoCOM.dll
- Step 2 ??dfm2pas??Delphi Client????
- Dfm2pas PCOMDemo.dpr PNETCOMDemo.dpr
- Dfm2pas fmMain.pas fmNETMain.pas
- Step 3??PNETCOMDemo.dpr, fmNETMain.pas
- Step 4 ??dccil
- Dccil v luPNETDemoCOM PNETDemoCOM.dpr
33.NET Application
Your Application or Package
.NET Framework
.Windows
.Data
.Web
.Xml
Etc.
Etc.
System
Win32
34.NETs System.Windows.Forms
Your Application or Package
.NET Framework
.Data
.Windows
.Web
.Xml
Etc.
Etc.
System
Win32
User32
ComCtrls
RichEd
35Delphi for .NET application
Your Application or Package
Your Application or Package
.NET Framework
.Windows.Forms
Borland.VCL
.Xml
.Net
.Web
.Data
Borland
System
Win32
36Delphi for .NET application
Your Application or Package
Your Application or Package
.NET Framework
.Windows.Forms
Borland.VCL
.Xml
.Net
.Web
.Data
Borland
System
Win32
37Delphi ? ? ? ? ? ? ? ? ? ? ? ? .NET ? ? ? ? ? ? ?
- BDE/IDAPI
- Midas
- dbExpress
- ADO.NET
38BDE/IDAPI
- Native drivers to various DataSource
- Oracle, MS SQL Server, InterBase, dBase, Paradox
- ?.NET???????BDE/IDAPI??
- ??, ?????BDE/IDAPI???????????
- VCL.NET??InterOp??.NET????BDE/IDAPI
39BDE/IDAPI
.NET ????
.NET InterOp Technology
IDAPI32.DLL
Sqlora8.dll
Sqlmss32.dll
Sqldb232.dll
Idpdx32.dll.dll
40BDE/IDAPI
- Borland.VCL.DB,
- Borland.VCL.BDE.DbTables,
- Borland.VCL.CDS.DBClient,
- Borland.VCL.DBGrids,
- Borland.VCL.DBCtrls
41BDE/IDAPI
42Midas
- Delphi 8???Midas
- Borland.Db.CDS.DBClient
- Borland.Db.CDS.DSIntf
- Borland.Db.CDS.Mconnect
- Borland.Db.CDS.Midas
- Borland.Db.CDS.Provider
- Borland.Db.CDS.TConnect
43BDE/IDAPI
44dbExpress
- Delphi 8????dbExpress???.NET?
45ADO.NET
- Delphi 8??????ADO.NET????
- Borland.Db.ADONET.ADONETDb
46The Next Generations C/C Tool
47The Target C Developers
C will remain the largest community through 2005
Professional Developers WorldWide
Source IDC
48Current Trends in the C market
- Large effort in maintenance of C code
- Multi-platform supported applications
- Mobile and Embedded support is strong
- C is preferred for performance computing
- Microsoft focus on managed code
- Migration from Unix to Linux on Intel
- The C standard is evolving.
49Enabling C Developers
Rapid Application Designers and Wizards
Re-usable component Development
System Libraries Connectivity and DB access
Operating System Feature Programming
Device Drivers/Hardware Specific Programming
50CBuilderX Overview
- Multi-platform IDE
- Same PrimeTime IDE (and look and feel) as
JBuilder - Windows, Linux, Solaris
- Multiple compiler toolchain support
- Supports Borland, Microsoft, GNU, Metrowerks,
Intel, Sun Forte - New Borland 100 ANSI/ISO C and C99 compliant
compiler - ALM integration
- Caliber, Together, StarTeam, Visibroker,
Interbase - Intel VTune Performance Analyzer, InstallShield
MultiPlatform - Visual Development environment
- Pure C RAD framework and designers
- Mobile solutions
- Supports any Symbian SDK
51CBuilderX ALM Integration
- Same level of integration as offered in JBuilder
9 - Caliber read-only client in Together
- Together Touch-Point integration
- StarTeam SCM advanced integration
- Intel VTune Performance Analyzer
- VisiBroker 5.2 integration
- Interbase 7.1 support
- InstallShield MultiPlatform
52Together Edition for CBuilderX Overview
- Provides an integrated and agile UML development
environment using the CBuilderX environment. - Adds ease in designing and working with classes,
the core of C - Creates visual models from code and keeps models
and code automatically synchronized - Provides audits and metrics capabilities to
improve and measure quality of applications
531983-2003
- 20 years of Turbo Charging
- Software Development Excellence
- 20 years of support for
- Microsoft operating systems, technologies, and
initiatives.
54CBuilderX Demo
55QA