Delphi XE and Winrunner (QTP) - delphi

We have a suite of automatic tests written in winrunner (QTP), and we have just upgraded to Delphi XE. I tried to modify TestSrvr.pas, MercControl.pas and MercCustControl.pas to manage unicode but I've still some problem. When I launch Winrunner I find "class" and "Label" but not anymore the "Delph_Name" and all automatic test use the "Delph_Name".
Does anyone have the same problem?
How do you update the Winrunner plugin to be compatible with DelphiXE ?
Thanks.

The Delphi plugin doesn't properly support Unicode. See earlier question and lack of answer. It isn't quite the answer to your problem, but it is something to keep in mind.

Related

NMUUE library for Delphi 7

I' m trying to run a project on Delphi 7 and getting file not found error 'NMUUE.dcu'. It is needed to create TNMUUProcessor object. Reinstalling doesn't help . So where can I find this library for my project?
I assume you've migrated this project from a lower version of Delphi. If I remember correctly, NMUUE is the UUE encoding unit for the Fastnet internet components. These didn't ship with Delphi 7 (I think Delphi 5 was the last version that supported them). I'm not sure if there's a download available for it still as NetMasters have gone out of business. Your best bet would be to migrate the project to use something like Indy.
That component is part of FastNet. It is not distributed with Delphi 7: http://edn.embarcadero.com/article/29766
The Fastnet components are no longer bundled with Delphi. It appears Netmasters does have a version compatible with Delphi 7 which can be purchased at: http://www.netmastersllc.com/
You probably will need to upgrade to a paid version of FastNet that supports Delphi 7, if such a thing can still be obtained, or switch to Indy.
On the other hand, if you are not actually doing anything more than uuencoding you could easily find a Delphi uuencode function with a websearch.
You probably ought to try to understand your program and what its requirements are before you proceed much further. Blindly solving missing dependencies without understanding why your program needs them is usually a recipe for future pain.

"Delphi Fundamentals" in Delphi 2009

Has anybody used/converted "Delphi Fundamentals" in Delphi 2009? - http://fundementals.sourceforge.net/
I'm using Dictionaries (cArrays.pas,cDictionaries.pas,cStrings.pas,cTypes.pas) in my project and now i have some troubles on upgrading code.
I'll be highly obliged if anybody can convert the above mentioned units in Delphi 2009. I'm quite new to Delphi, started working with 2007 and 2009 has been released, I just cannot help myself...
Thank you
I use cUtils, cDateTime and cStrings in a project.
After a 30 minute session of searching and replacing like a madman I got them to compile in Delphi 2009, with just a couple of warnings left to fix.
Char>>>>AnsiChar
String>>>>AnsiString
PChar>>>>PAnsiChar
PString>>>>PAnsiString
It passes all of its selftests, and so far things seem to work fine. I've shared it here: http://www.xs4all.nl/~niff/Fundamentals_UtilsD2009.zip
Update
I've added a ported cDataStructs.pas to the zipfile, which contains the dictionary classes. This one still has a lot of compiler warnings that you might want to fix, but the self-tests pass, so you could try and see if it works for you..
There is no official version of Delphi Fundamentals for D2009 (and I think there never will be any).
I think it would be the best option to rewrite the dictionary code using the Delphi-native TDictionary<TKey,TValue> class inside Generics.Collections.pas, or using the delphilhlplib (Collections/DeHL.Collections.Dictionary.pas).

Delphi code formatter

Are there any utilities that reformat Delphi code ?
EDIT
I am using Delphi 2006
Some feedback
Thanks to all that answered this question
I have been using the JCF code formatter - it works well and my code is been formated to Object Pascal Style Guide
You can try the "Jedi code Format". See more information here: http://jedicodeformat.sourceforge.net/
The formatting engine of DelForExp has been integrated into the code base of GExperts. An experimental version of GExperts including a "Code formatter" here:
http://blog.dummzeuch.de/experimental-gexperts-version/
Separate information/downloads for DelForExp here.
Regards.
I have been for some time releasing experimental GExperts versions that include the code formatter formerly known as DelForEx with some improvements and fixes. The latest release is from 2020-10-23 and supports the following Delphi versions:
Delphi 6 to 7
Delphi 2005 to 2010
Delphi XE
Delphi XE2 to XE8
Delphi 10 to 10.4
Delphi 11 (Danger, Alpha version for now 2021-10-24)
Please note, though, that I am using it only with Delphi 2007, so the other versions may have unknown bugs. Also, not all language improvements of later Delphi versions will work, e.g. nested types, generics and anonymous methods.
see gexperts.dummzeuch.de for details.
btw: Any help improving the formatter, especially adding the new language constructs would be appreciated. The source code can be downloaded from the subversion repository linked from my homepage.
I found this: JEDI Code Format
lextudio - Code Beautifier Collection 6 for CodeGear RAD Studio 2007
http://code.google.com/p/lextudio/
Yes,
I always used TWM's experimental version os GExperts which support this feature.
In Delphi 2006 and 2007 it works perfectly (Don't know about older versions though).
The current version is adding support to Delphi 2009, but I don't know in which stage it is, you can find more about it here:
http://www.dummzeuch.de/delphi/gexperts/english.html
BTW: There is an integrated Source Code Formatter since Delphi 2010.
Free Pascal also has a codeformatter, ptop, but it only implements the more basic dialect (say D4-D6 level).
Lazarus recently changed to use the Jedi codeformatter afaik.
The TWM version of GExperts works well and is nicely integrated into the IDE. It enables you to write and modify your code without worrying too much about exact formatting, then just hit the assigned hot-key and it instantly reformats. I have always found it easy to set up to match the style I prefer, and not as complex as JEDI Code Format, which looked like overkill to me.
The Delphi 2009 version is now available from the link posted above, though based on a beta release of GExperts. It is still much the same formatter underneath, though, and is unaware of the syntax of some of the newer Delphi enhancements.
I just made an online pascal code beautifier based on JCF. You may try it at https://pak.lebah.web.id/jcf
HTH.
There is OPEdit II which is free, and works very well.
It's a full text editor, with code refactoring and code browsing.
There is a text formatter, which uses the internal code parser, therefore handle conditional defines just as a real Delphi compiler.
See http://www.codefactor2.com
There is a program PascalFormat

Why is Indy 9 included with Delphi 2009? Is it safe to use?

Why is there an Indy9 folder (The default install folder of C:\Program Files\CodeGear\RAD Studio\6.0\source\Indy contains subdirectories for "Indy9" and "Indy10") Why are both versions installed? What is using Indy9? I didn't think it had been updated for 2009...is Indy9 now safe to use with Delphi 2009?
There is an opened QC report about this, but it's only visible to QC sysops.
The status of "open" typically means that it's accepted that this is a bug, rather than by design.
Remy Lebeau - one of the Indy developers - said this:
The 2009 installer does ship with the
Indy 9 source code, but it is not
selectable during install. There is a
note in the documentation that Indy 9
can be installed manually if needed.
But keep in mind that Indy 9 has not
been updated to actually support 2009.
At the moment, I am not sure if it
will be.
There are some changes in Indy 9 (from the 2007 version) so that it will compile under Delphi 2009 (a few String to AnsiString changes), but based on my tests it doesn't work. It tries to, but does not connect. If you want I can give you the changes that have been added for Unicode support, but I don't believe they are sufficient.
I can't really answer why. I could conjecture a few reasons, but I do not have any insider information.
Is it safe to use? YMMV. There is a lot to Indy, so there may be some parts that work fine for your project. Even a simple test with the TIdTCPClient resulted in Socket Error #11004 every time. Same for TIdHTTP. It seems like I tried the MD5 previously and it just got garbage, but I am not sure on that one.
Answer: It was included by mistake (assumption), and it is not safe to use (based on limited tests).
That is unfortunate, because Indy 10 has issues too, and I have some legacy apps that use Indy 9.
Indy9 is there for compatibility. There were some breaking changes in Indy10 (your code that was written against Indy9 may not compile under Indy10) so you have the option of continuing to use Indy9 (I think the installer prompts and asks what Indy you want to use - at least it did with D2007).
Update: Okay a few people have correctly commented that Indy9 wont compile with D2009 (because of the new Unicode support), so I guess I don't know why it is there.
My guess, it was in the source tree, and was automatically included by installer.
Keep in mind that the source files are not used unless you tell Delphi to recompile them.
If you do not have the Enterprise version you will not even have these folders.

Delphi 2009 TurboPower library conversions

In the next few months I will be resurrecting a project which made extensive use of Orpheus and SysTools. The development system I used is long gone, so would like to update the libraries to my current development environment.
My question(s): is anyone porting, or has anyone ported the TurboPower libraries to Tiburon, if so did you encounter any problems; and if the answer is nobody, is it worth collaborating to produce a Delphi 2009 version, sharing the load.
Some components in the process of being ported to Delphi 2009, including 5 TurboPower libraries. No Orpheus or SysTools, though.
http://www.songbeamer.com/delphi/
Update:
As M Plaut pointed out, Orpheus has been added to the site and has been updated as recently as Nov 13.
Orpheus407AU_3 was posted at http://sourceforge.net/projects/tporpheus/ on Sept 5, 2009.
There is Orpheus project at SourceForge but last release was made in 2005 :(
Systools is also to be found there.
When turbo power closed their doors, I analysed my code that was using Orpheus and SysTools. I found that there were only a handful of SysToosl functions I was using and so we wrote our own functions. (Can't remember what they were)
It was fairly straight forward, some of them were in the newer versions of Delphi and the rest were easy to code.
Orpheus was a little more difficult. I would be willing to throw some time into bringing back Orpheus. We replaced it with standard Delphi components and some code, but our applications lacks some of the coolness it once had.
We would definitely be looking to port this as well. We use alot of Orpheus components in our current applications and this would be a definite roadblock to Delphi 2009.
As of 10-11-2008, there is a version at http://www.songbeamer.com/delphi/
of Orpheus as well. The following comments are attached:
This is based on the version from CVS. The first two packages compile and are partly tested. Some asm code still needs updating. Some bugfixing also need to be found and fixed. Contributions are welcome (use the contact form on the top). Search for "FIXME" in the source.
Files that may need special attention and bugfixes: OVCDRPVW.PAS, OVCPF.PAS, OVCEDITU.PAS, OVCVIEWR.PAS, OVCSTR.PAS
I have to bring a very old project to delphi 2009 : a CNC editor. The project didn't use Orheus at that time, but I was looking into it (did some tests), and the orpheus text editor is still the fastest on the market. So yes, I am very interested. I tried to compile the old source in delphi 9, but it crashes.
I am not a good programmer, but I can do tests for you.

Resources