Migrate from Delphi 2007 for Win32 to Delphi XE

we use Delphi 2007 for Win32 to support legacy (32Bit) OWL-based pascal applications (yes i know it was a mistake not to switch to VCL 15 years ago).

could our applications still be opened and compiled with Delphi XE?
The existing projects are all plain Pascal-Code, coming back from the times of Turbo Pascal for Windows and later on Borland Pascal.

Are there any improvements we could profit from (i.e IDE, Debugger)?

Thanks
Andrej
0
Andrej
9/28/2010 9:09:16 AM
embarcadero.delphi.non-tech 5934 articles. 1 followers. Follow

18 Replies
1190 Views

Similar Articles

[PageSpeed] 48

> {quote:title=Andrej Dimic wrote:}{quote}
> could our applications still be opened and compiled with Delphi XE?

I'm not sure, but I guess they will.

The big change since Delphi 2009 (then Delphi XE) is the new string = UnicodeString paradigm.

But OWL uses shortstring for its string storage, as far as I remember.
This shortstring type is still an Ansi string  in Delphi 2009/2010/XE.
So I think it'll work as expected, if you don't mix shortstring/string types in your code.

IMHO the problem could be not in the OWL code, but in the way you use strings in your own code...
So your migration problem is more like any other Delphi 2007/Delphi 2009 migration.

In all cases, you can download RadStudio XE trial, then install it in a virtual machine, then try to recompile your code.
You'll have 30 days for the free trial. If it's sucessfull, you could upgrade to XE. But I don't see much benefit here.
0
Arnaud
9/28/2010 10:20:11 AM
> {quote:title=Arnaud BOUCHEZ wrote:}{quote}
> IMHO the problem could be not in the OWL code, but in the way you use strings in your own code...

On 2nd though, I guess that all the Win32 API calling convension changed since Delphi 2009.
Before Delphi 2009, the default API call was the Ansi Version.
Since Delphi 2009, the default API call is the Wide Version.

So perhaps OWL will call, for instance, CreateWindow in its code, expecting calling CreateWindowA...
But since Delphi 2009, the CreateWindow API will call CreateWindowW... therefore there'll be an error here, because your shortstring will be an ansi string mapped to a Wide (UCS-2) windows API!

I suspect some nightmares here...
0
Arnaud
9/28/2010 10:23:01 AM
isn't there is a compiler-switch to accommodate to the ANSI or Wide Interface?
As far as i remember the win32-API interface definitions do have ifdef's for A and W.

What do you think?


> {quote:title=Arnaud BOUCHEZ wrote:}{quote}
> > {quote:title=Arnaud BOUCHEZ wrote:}{quote}
> > IMHO the problem could be not in the OWL code, but in the way you use strings in your own code...
> 
> On 2nd though, I guess that all the Win32 API calling convension changed since Delphi 2009.
> Before Delphi 2009, the default API call was the Ansi Version.
> Since Delphi 2009, the default API call is the Wide Version.
> 
> So perhaps OWL will call, for instance, CreateWindow in its code, expecting calling CreateWindowA...
> But since Delphi 2009, the CreateWindow API will call CreateWindowW... therefore there'll be an error here, because your shortstring will be an ansi string mapped to a Wide (UCS-2) windows API!
> 
> I suspect some nightmares here...
0
Andrej
9/28/2010 12:33:09 PM
Andrej Dimic wrote:

> could our applications still be opened and compiled with Delphi XE?

I would be very surprised if you could successfully compile and run OWL
code with D2010 or above.

-- 
Nick Hodges -- Product Development Manager
Gateway Ticketing Systems
http://www.gatewayticketing.com
0
Nick
9/28/2010 12:53:41 PM
Hi Nick,

Can you give contact information to contatct you?

Fred Decker
ExceleTel
Raleigh, NC.
0
Fred
9/28/2010 2:21:58 PM
Fred Decker wrote:

> Can you give contact information to contatct you?

Sure --

nhodges@gatewayticketing.com

-- 
Nick Hodges -- Product Development Manager
Gateway Ticketing Systems
http://www.gatewayticketing.com
0
Nick
9/28/2010 2:36:26 PM
I agree about any software that interactes directly with the wndows API. Our code is nothing but windows API calls, windows messages, and dealing with pointers, structures and null terminated strings. It was not easy making the conversion for us. We had to look at every Pchar, every string, every API call, etc, and see what was needed on a routine by routine basis. Some internal routines that used strings as chars could be shortstrings, the rest had to be unicode strings. All of our pointer math had to be
 re-written.  Anyway, there are a lot of good documents on the web and especially on the embarcadero site explaining exactly all of the things you need to consider (if you even have the source code for everything you need to recompile). Just search for "convert delphi unicode".

We did take one temporary shortcut when working with another library. All of our code to that tool basically ran through just a few routines. So we converted anything down to AnsiString for those and converted them back. You convert to ANSI as late as possible and to unicode as early as possible. We also put in IFDEFS so that the code could compile in non unicode Delphi versions too.  Some changes make the code work without having ifdefs, for example calls to  chars holding strings that need a "length". P
reviously, a char was always a byte, but it can be anything now so you need to be careful with length and sizeof.  Nick Hodges (who responded to you and used to work for Embarcadero) has a great multi-part article on "unicodifying" your code. Chris Bensen and Marco Cantu also have articles.
0
Fred
9/28/2010 2:36:31 PM
Andrej Dimic wrote:
> isn't there is a compiler-switch to accommodate to the ANSI or Wide Interface?
> As far as i remember the win32-API interface definitions do have ifdef's for A and W.
>
> What do you think?

That is C interfaces
But Delphi does not have any such switch
0
Olivier
9/28/2010 2:54:54 PM
"Arnaud BOUCHEZ" wrote in message news:290922@forums.embarcadero.com...
>
> But OWL uses shortstring for its string storage, as far as I remember.
> This shortstring type is still an Ansi string  in Delphi 2009/2010/XE.
> So I think it'll work as expected, if you don't mix shortstring/string 
> types in your code.

The problem is, IIRC, in TP/TPW you could simply declare a variable as type 
string and it would default to string[255]. Since Delphi 2 that has not been 
true. However, a global replace on such instances to either add '[255]' of 
change the type to shortstring should be enough to clear that up.

-- 
Wayne Niddery (TeamB)
0
Wayne
9/29/2010 12:32:40 AM
Wayne Niddery wrote:


> The problem is, IIRC, in TP/TPW you could simply declare a variable
> as type string and it would default to string[255]. Since Delphi 2
> that has not been true. 




Delphi 2 had a compiler switch for ansistrings/shortstrings 
IIRC.





-- 
Arthur Hoornweg

--------------------------
To answer me by e-mail, please remove the ".net" part from my
e-mail address leaving everything else intact. I had to take this
measure to counteract unsollicited mail.
0
Arthur
10/1/2010 7:12:46 AM
Nick Hodges wrote:

> Sure --


Nick, aren't you worried about bots harvesting e-mail addresses 
from forums like these? 




-- 
Arthur Hoornweg

--------------------------
To answer me by e-mail, please remove the ".net" part from my
e-mail address leaving everything else intact. I had to take this
measure to counteract unsollicited mail.
0
Arthur
10/1/2010 7:14:11 AM
Arthur Hoornweg wrote:

> Nick, aren't you worried about bots harvesting e-mail addresses 
> from forums like these? 

I figure there isn't anything to be done about it -- it will happen no
matter what.

-- 
Nick Hodges -- Product Development Manager
Gateway Ticketing Systems
http://www.gatewayticketing.com
0
Nick
10/1/2010 7:38:04 PM
On 01.10.2010 21:38, Nick Hodges wrote:
> Arthur Hoornweg wrote:
>
>> Nick, aren't you worried about bots harvesting e-mail addresses
>> from forums like these?
>
> I figure there isn't anything to be done about it -- it will happen no
> matter what.
>

I have mail lists that's never been exposed to Internet at all, just 
sent mail to a few people in a genealogical book editors.

But it is being spammed, most probably because at least one has a 
computer that has been infected.

Only one option to never be spammed.

Drop any contact with any other people and dig a big hole in ground and 
stay there for lifetime

:-D
0
Alf
10/1/2010 11:32:18 PM
Alf Christophersen wrote:

> Only one option to never be spammed.
> 
> Drop any contact with any other people and dig a big hole in ground
> and stay there for lifetime

Hehe -- exactly.  ;-)

-- 
Nick Hodges -- Product Development Manager
Gateway Ticketing Systems
http://www.gatewayticketing.com
0
Nick
10/1/2010 11:38:07 PM
Arthur Hoornweg wrote:

> Wayne Niddery wrote:
> 
> 
> > The problem is, IIRC, in TP/TPW you could simply declare a variable
> > as type string and it would default to string[255]. Since Delphi 2
> > that has not been true. 
> 
> Delphi 2 had a compiler switch for ansistrings/shortstrings 
> IIRC.

Indeed and it still is available in XE, but I must admit that I don't
know if it still works, the last time I used this was ... hmm ... oh
err ... I never used it ;-)

-- 
Pieter

"Giving birth is like taking your lower lip and forcing it over
 your head." - Carol Burnett.
0
Pieter
10/1/2010 11:56:53 PM
Arthur Hoornweg wrote:

> Nick, aren't you worried about bots harvesting e-mail addresses 
> from forums like these? 

JFTR: unlike in NNTP on the forums it is "scrambled" as:
  nhodges at gatewayticketing dot com

-- 
Pieter

"If you pray for rain long enough, it eventually does fall. If
 you pray for floodwaters to abate, they eventually do. The same
 happens in the absence of prayers."
 -- Steve Allen
0
Pieter
10/1/2010 11:56:54 PM
Alf Christophersen wrote:

> Only one option to never be spammed.
> 
> Drop any contact with any other people and dig a big hole in ground and 
> stay there for lifetime

http://www.dumbentia.com/pdflib/scissors.pdf

-- 
Anders Isaksson, Sweden
BlockCAD: http://www.blockcad.net  
Gallery: http://www.blockcad.net/gallery/index.htm
0
Anders
10/4/2010 9:59:41 AM
On 04.10.2010 11:59, Anders Isaksson wrote:
> Alf Christophersen wrote:
>
>> Only one option to never be spammed.
>>
>> Drop any contact with any other people and dig a big hole in ground and
>> stay there for lifetime
>
> http://www.dumbentia.com/pdflib/scissors.pdf
>

Haha. Videresendt :-)
0
Alf
10/9/2010 2:45:29 PM
Reply:

Web resources about - Migrate from Delphi 2007 for Win32 to Delphi XE - embarcadero.delphi.non-tech

1-800-Flowers Becomes the First Client to Migrate to Facebook’s Revamped Atlas Ad Platform
... platform , which Facebook announced at Advertising Week 2014 in New York at the end of September, has its first client, as 1-800-Flowers migrated ...

Facebook Migrates 400,000 Users to Fans of Apple’s Page
While Facebook has been turning up the marketing on businesses and brand owners to create Facebook Pages, one feature of Pages that is less well ...

Why, when and how to migrate to Windows 8 - Windows 8 migration, Windows 8 deployment, Windows 8, Windows ...
Windows 8 machines are coming out sometime this fall, but that doesn't mean businesses should shift to panic mode to upgrade their corporate ...

'You don't migrate to this country unless you want to join our team': Tony Abbott renews push on national ...
Prime Minister Tony Abbott has elaborated on his "Team Australia" remarks, telling a radio interview that "you don't migrate to this country ...

Tony Abbott's woman problem migrates to his ministry
Tony Abbott is having women trouble. It's nothing he said, mind.

Doctors and Nurses From Poor Countries Migrate To Rich Ones
Australia has saved almost $640 million by poaching doctors from some of the poorest countries in Africa.

ISIS recruitment video Join the Ranks urges Indonesian Muslims to migrate to the Islamic State
A video released by the terrorist group shows Indonesian men urging Muslims to wage join the jihad.

Polar bears migrate to Canadian Arctic for longer lasting ice: study
Some polar bear clusters have slowly moved to islands north of Canada's mainland that are retaining the Arctic ice for longer, according to a ...

Apple now allows developer MobileMe users to migrate their accounts to iCloud
As promised, Apple has opened up a new portal at me.com/move for developers that the MobileMe service to migrate their entire account over to ...

Verizon Explains the Real Reason Geese Migrate
Every weekday, we bring you the Ad Age/iSpot Hot Spots , new and trending TV commercials tracked by iSpot.tv , a company that catalogs, tags ...

Resources last updated: 11/22/2015 8:27:48 AM