Board index » delphi » Highlander question - Win32/.Net

Highlander question - Win32/.Net


2007-08-30 02:38:40 PM
delphi32
I have a question to do with Highlander and Win32 / .Net.
We currently have a product in Delphi 7 which started in Delphi 3, moved to
Delphi 5, then 7. We did purchase Delphi 2005, but never upgraded for
various (obvious) reasons. We've specifically held off until Highlander
(although we have been tempted by D2007).
My question relates to the ability to convert a Win 32 project to a .Net
project.
My understanding with Delphi 2005, when you first opened an older project,
you were given the option to upgrade to Win 32 or VCL.Net.
Does this work the same way if we were going to open our Delphi 7 source
code in Highlander?
Further to this, if we chose Win32 initially and the source is converted to
be used as a Highlander Win 32 application, is there a way of converting
this to a VCL.Net application down the track if we needed to go .Net?
We are continually making enhancements to our product. Our product
interacts with things like Crystal Reports. There may come a time where we
need to cut across to a VCL.Net version. If we were to go with Win 32 on
Highlander initially, is there any way to change the current project to
VCL.Net down the track? Or are we locked into whichever one we chose
initially?
Kind Regards,
Mick.
 
 

Re:Highlander question - Win32/.Net

Mick Board a écrit :
Quote
My question relates to the ability to convert a Win 32 project to a .Net
project.
Whatever facilities an IDE may provide, assuming that you can just
recompile a Win32 app to .NET is asking for problems. There are
differences in memory management (Win32 is deterministic, .NET uses
garbage collection).
There is also the issue of strings being immutable in .NET that can
cause perceptions that .NET string concatenation is slow (it is) and the
need to use the StringBuilder class to regain speed.
Interfaces in Win32 are reference counted and require the const modifier
on method arguments whereas, in .NET, interfaces are no longer tied to
the COM implementation of _AddRef, _Release and QueryInterface. .NET
interfaces do not require a GUID, are not reference counted and can be
freely exchanged with object references; it is even possible to cast
from an interface to an object, something not possible in Win32.
.NET 2.0 provides Generics wshich can drastically change the way you
write code as it removes the need to write typesafe versions of lists,
etc. In.NET, if you were to hold integers in an ArrayList, there is a
speed penalty involved in what is known as boxing and unboxing as the
integer will be boxed into an object on adding and unboxed on extraction
from the list. Generic lists are truly lists of whatever type they are
bound to, there is no boxing/unboxing involved.
And there are other considerations as well.
Joanna
--
Joanna Carter [TeamB]
Consultant Software Engineer
 

Re:Highlander question - Win32/.Net

Hi Mick,
Quote
Does this work the same way if we were going to open our Delphi 7 source
code in Highlander?
Yes.
Quote
Further to this, if we chose Win32 initially and the source is converted to
be used as a Highlander Win 32 application, is there a way of converting
this to a VCL.Net application down the track if we needed to go .Net?
Yes, but it takes more than just compiling for .NET. You need to ensure
you have the .NET counterparts of the third-party controls you're using
as well, plus there are source code specific issues (safe, managed code).
See dn.codegear.com/article/32983 for an article that covers the
migration from VCL to VCL for .NET using Delphi 2005, or read
www.drbob42.com/pdf/del_migrating_delphi_win32_to_dotnet.pdf for
for a white paper that gives an overview of what it takes to migrate
Win32 code to .NET (this was written in the time of Delphi 8 by the way)
Quote
We are continually making enhancements to our product. Our product
interacts with things like Crystal Reports. There may come a time where we
need to cut across to a VCL.Net version. If we were to go with Win 32 on
Highlander initially, is there any way to change the current project to
VCL.Net down the track? Or are we locked into whichever one we chose
initially?
If you are looking for a Win32 / .NET single source project, that can be
compiled to either Win32 or .NET depending on a single setting, then I
must warn you that this may be hard to accomplish.
Quote
Kind Regards,
Mick.
Groetjes,
Bob Swart
--
Bob Swart Training & Consultancy (eBob42.com) Forever Loyal to Delphi
CodeGear Technology Partner -- CodeGear RAD Studio Reseller (BeNeLux)
Blog: www.drbob42.com/blog - RSS: eBob42.com/weblog.xml
 

Re:Highlander question - Win32/.Net

Hi,
Its a good idea to tier your application.
Move common non visual code into its own tier.
Then you can take advantage of whatever features the platform has for you
for your visual appearance and
thus only need to maintain relatively little code to be able to compile and
run on multiple platforms.
best regards
Kim Madsen
XXXX@XXXXX.COM
www.components4developers.com
Highly scalable high performance high uptime application server tools
Build by developers for developers.
"Mick Board" <XXXX@XXXXX.COM>writes
Quote
I have a question to do with Highlander and Win32 / .Net.

We currently have a product in Delphi 7 which started in Delphi 3, moved
to Delphi 5, then 7. We did purchase Delphi 2005, but never upgraded for
various (obvious) reasons. We've specifically held off until Highlander
(although we have been tempted by D2007).

My question relates to the ability to convert a Win 32 project to a .Net
project.

My understanding with Delphi 2005, when you first opened an older project,
you were given the option to upgrade to Win 32 or VCL.Net.

Does this work the same way if we were going to open our Delphi 7 source
code in Highlander?

Further to this, if we chose Win32 initially and the source is converted
to be used as a Highlander Win 32 application, is there a way of
converting this to a VCL.Net application down the track if we needed to go
.Net?

We are continually making enhancements to our product. Our product
interacts with things like Crystal Reports. There may come a time where
we need to cut across to a VCL.Net version. If we were to go with Win 32
on Highlander initially, is there any way to change the current project to
VCL.Net down the track? Or are we locked into whichever one we chose
initially?

Kind Regards,
Mick.


 

Re:Highlander question - Win32/.Net

Hi!
Mick Board writes:
Quote
[...]
My question relates to the ability to convert a Win 32 project to a ..Net
project. [...]
Since that can be a real pita you should also have a look at RemObjects' Hydra www.remobjects.com/product/
It's real powerful in archieving a "soft" migration from Win32 to .NET.
Robert
--
blog.robertsoft.de
 

Re:Highlander question - Win32/.Net

Quote
Further to this, if we chose Win32 initially and the source is converted
to be used as a Highlander Win 32 application, is there a way of
converting this to a VCL.Net application down the track if we needed to go
.Net?

Yes - you simply delete or rename your bdsproj file and you will be prompted
again when you open the dpr file.
In addition you can have multiple 'bdsproj' files all pointing to the same
project. Simply open the one you want (e.g. project1win32.bdsproj or
project1dotnet.bdsproj) and it will compile your project using VCL or
VCL.NET.
David
 

Re:Highlander question - Win32/.Net

"David Wilcockson" <dnwatlibriosdotcom>writes
Quote
>Further to this, if we chose Win32 initially and the source is converted
>to be used as a Highlander Win 32 application, is there a way of
>converting this to a VCL.Net application down the track if we needed to
>go .Net?
>

Yes - you simply delete or rename your bdsproj file and you will be
prompted again when you open the dpr file.

In addition you can have multiple 'bdsproj' files all pointing to the same
project. Simply open the one you want (e.g. project1win32.bdsproj or
project1dotnet.bdsproj) and it will compile your project using VCL or
VCL.NET.

David

Thank you David. that is what I was wanting to know.
Regards,
Mick.
 

Re:Highlander question - Win32/.Net

Quote
If you are looking for a Win32 / .NET single source project, that can be
compiled to either Win32 or .NET depending on a single setting, then I
must warn you that this may be hard to accomplish.

Thanks Dr Bob. I will keep in mind all that you've said. I wasn't looking
for a "magic" solution here. I was just wondering if there was a way to
invoke the wizard (or whatever Highlander uses) to convert the code to use
the VCL.Net if we'd gone down the Win32 path to start with. If we have to
take that VCL.net path at some stage, I am sure there'd be lots and lots of
other issues we'd need to deal with then.
Kind Regards,
Mick.
 

Re:Highlander question - Win32/.Net

"Robert Wachtel" <XXXX@XXXXX.COM>writes
Hi!
Mick Board writes:
Quote
[...]
My question relates to the ability to convert a Win 32 project to a .Net
project. [...]
Since that can be a real pita you should also have a look at RemObjects'
Hydra
www.remobjects.com/product/
It's real powerful in archieving a "soft" migration from Win32 to .NET.
Robert
--
blog.robertsoft.de
Thanks Robert.
I'll take a look.
Kind Regards,
Mick.
 

Re:Highlander question - Win32/.Net

"Joanna Carter [TeamB]" <XXXX@XXXXX.COM>writes
Quote
Mick Board a écrit :

>My question relates to the ability to convert a Win 32 project to a .Net
>project.

Whatever facilities an IDE may provide, assuming that you can just
recompile a Win32 app to .NET is asking for problems. There are
differences in memory management (Win32 is deterministic, .NET uses
garbage collection).

There is also the issue of strings being immutable in .NET that can cause
perceptions that .NET string concatenation is slow (it is) and the need to
use the StringBuilder class to regain speed.

Interfaces in Win32 are reference counted and require the const modifier
on method arguments whereas, in .NET, interfaces are no longer tied to the
COM implementation of _AddRef, _Release and QueryInterface. .NET
interfaces do not require a GUID, are not reference counted and can be
freely exchanged with object references; it is even possible to cast from
an interface to an object, something not possible in Win32.

.NET 2.0 provides Generics wshich can drastically change the way you write
code as it removes the need to write typesafe versions of lists, etc.
In.NET, if you were to hold integers in an ArrayList, there is a speed
penalty involved in what is known as boxing and unboxing as the integer
will be boxed into an object on adding and unboxed on extraction from the
list. Generic lists are truly lists of whatever type they are bound to,
there is no boxing/unboxing involved.

And there are other considerations as well.

Joanna

--
Joanna Carter [TeamB]
Consultant Software Engineer
Thanks for the great advice here Joanna.
As I have now mentioned in other replies, I was just wondering if there was a
way to invoke the wizard (or whatever Highlander uses) to convert the code
to use the VCL.Net if we'd gone down the Win32 path to start with.
This is all really good and I will bear it in mind if we have to look at going
down this path. it is great to have some idea of the sorts of things that
we'd have to consider.
Kind Regards,
Mick.
 

Re:Highlander question - Win32/.Net

Frank J a écrit :
Quote
Gee wiz!!
No one needed a .NET 101 speech :)
When it comes to migrating from Win32 to .NET, you can never take enough
caution. There are lots of gotchas which have already caused many people
to abandon any idea of .NET because they didn't realise that Win32 code,
in certain areas, simply cannot be ported directly to .NET without
incurring all manner of speed and memory problems.
Joanna
--
Joanna Carter [TeamB]
Consultant Software Engineer
 

Re:Highlander question - Win32/.Net

Quote
.. a way to invoke the wizard (or whatever Highlander uses)
I fear you are deluding yourself...
When you open a .DPR file in the new IDE, yes it asks if you want to update
the project to a new format. But this just creates a new .BDSPROJ file out
of the data in your .DPR file; (this new is compatible with MSBuild whereas
the .DPR is not).
i.e. don't expect some miraculous "conversion" of your .PAS files into any
other platform...
AndrewFG
 

Re:Highlander question - Win32/.Net

"Frank J" <XXXX@XXXXX.COM>writes
Quote

>

Gee wiz!!
No one needed a .NET 101 speech :)
Actually, I rather appreciated Joanna's comments.
Ray Porter
 

Re:Highlander question - Win32/.Net

What is the reason that you want to switch to VCL.NET. Why don't you stay in
VCL. It has many advatances:
- No .NET runtime needed
- Better supported by 3rd party component vendors
- Native code is always faster than .NET code
Best regards,
Jaakko
 

Re:Highlander question - Win32/.Net

"Jaakko Salmenius" <jaakko.salmenius (at) nospam gmail.com>writes
Quote
What is the reason that you want to switch to VCL.NET. Why don't you stay
in VCL. It has many advatances:
- No .NET runtime needed
- Better supported by 3rd party component vendors
- Native code is always faster than .NET code

Best regards,
Jaakko

I don't want to move to VCL.Net and understand the reasons for not moving.
As an example, Business Objects will be supporting Crystal Reports in future
versions for the Microsoft Platform via .Net only. No VCL. No Active X!
We've made a significant investment with reporting in Crystal. Yes we could
change to something else and may yet do so.
However, the question I am asking myself daily is if the major players are
seeing the future of the Microsoft Platform as .Net, where is that going to
leave things in a few years time?
Regards,
Mick.