ArcGIS runtime errors after upgrading from Delphi 2007 to Delphi XE3

We have an application written in Delphi Pascal that accesses the ArcGIS 9.3 API through the COM interface. We recently upgraded from Delphi 2007 to Delphi XE3 and ever since we upgraded we have been getting runtime errors in the ArcGIS libraries that we were not getting before.

Specifically the error is always "invalid floating point operation".

The first one that was occurring was happening in the method "sg.SgCoordRefSetZ". I was able to eliminate this error by adding a call to FGeoSpatialReference.SetZDomain(-10000, 100000.0) even though there is nowhere that we're using Z coordinates.

The second one I found was caused by adding features to a feature class without a geometry defined. For that I simply tested for an empty geometry and didn't add the feature if the geometry was nil.

I have a new one that's occurring in the same bit of code as the first one (i.e. "sg.SgCoordRefSetZ") but it happens when I call FMapControl.LoadMxFile(MapDocumentFileName); There is no way I can trace this.

The confusing part, and my question, is why are these errors happening after upgrading Delphi from 2007 to XE3 and not before.

I'm writing this out of frustration and desperation, so if I come across as being frustrated or desperate, that's why.
0
Thomas
2/23/2013 12:33:10 AM
embarcadero.delphi.ole 598 articles. 1 followers. Follow

2 Replies
898 Views

Similar Articles

[PageSpeed] 28

Thomas Bates wrote:

> We have an application written in Delphi Pascal that accesses the
> ArcGIS 9.3 API through the COM interface. We recently upgraded from
> Delphi 2007 to Delphi XE3 and ever since we upgraded we have been
> getting runtime errors in the ArcGIS libraries that we were not
> getting before.
> 
> Specifically the error is always "invalid floating point operation".
> 
> The first one that was occurring was happening in the method
> "sg.SgCoordRefSetZ". I was able to eliminate this error by adding a
> call to FGeoSpatialReference.SetZDomain(-10000, 100000.0) even though
> there is nowhere that we're using Z coordinates.
> 
> The second one I found was caused by adding features to a feature
> class without a geometry defined. For that I simply tested for an
> empty geometry and didn't add the feature if the geometry was nil.
> 
> I have a new one that's occurring in the same bit of code as the
> first one (i.e. "sg.SgCoordRefSetZ") but it happens when I call
> FMapControl.LoadMxFile(MapDocumentFileName); There is no way I can
> trace this.
> 
> The confusing part, and my question, is why are these errors
> happening after upgrading Delphi from 2007 to XE3 and not before.

There are two sources of these FPU errors i'm aware of:

 - using uninitialized floating-point variables. Such variables may
then contain bit patterns that correspond to a NaN or Inf value by
chance, which can cause errors when they are used, especially by an
external library.

 - the settings of the FPU control word. THis has always been a sore
point when using external libraries, since those may make assumptions
about how the FPU flags are set which the Delphi side does not match. I
don't know whether the Delphi RTL default has changed in this area
between D2007 and XE3, but it would explain the differences you see
between the versions.

Search Google or codenewsfast.com for Set8087CW, that should turn up a
lot of threads for related problems.
Also check the docs for the COM object you are using, perhaps you can
find the expected settings for the control word there.


-- 
Peter Below (TeamB)
0
Peter
2/23/2013 8:45:22 AM
> {quote:title=Peter Below wrote:}{quote}
> Thomas Bates wrote:
> 
> > We have an application written in Delphi Pascal that accesses the
> > ArcGIS 9.3 API through the COM interface. We recently upgraded from
> > Delphi 2007 to Delphi XE3 and ever since we upgraded we have been
> > getting runtime errors in the ArcGIS libraries that we were not
> > getting before.
> > 
> > Specifically the error is always "invalid floating point operation".
> > 
> > The first one that was occurring was happening in the method
> > "sg.SgCoordRefSetZ". I was able to eliminate this error by adding a
> > call to FGeoSpatialReference.SetZDomain(-10000, 100000.0) even though
> > there is nowhere that we're using Z coordinates.
> > 
> > The second one I found was caused by adding features to a feature
> > class without a geometry defined. For that I simply tested for an
> > empty geometry and didn't add the feature if the geometry was nil.
> > 
> > I have a new one that's occurring in the same bit of code as the
> > first one (i.e. "sg.SgCoordRefSetZ") but it happens when I call
> > FMapControl.LoadMxFile(MapDocumentFileName); There is no way I can
> > trace this.
> > 
> > The confusing part, and my question, is why are these errors
> > happening after upgrading Delphi from 2007 to XE3 and not before.
> 
> There are two sources of these FPU errors i'm aware of:
> 
>  - using uninitialized floating-point variables. Such variables may
> then contain bit patterns that correspond to a NaN or Inf value by
> chance, which can cause errors when they are used, especially by an
> external library.
> 
>  - the settings of the FPU control word. THis has always been a sore
> point when using external libraries, since those may make assumptions
> about how the FPU flags are set which the Delphi side does not match. I
> don't know whether the Delphi RTL default has changed in this area
> between D2007 and XE3, but it would explain the differences you see
> between the versions.
> 
> Search Google or codenewsfast.com for Set8087CW, that should turn up a
> lot of threads for related problems.
> Also check the docs for the COM object you are using, perhaps you can
> find the expected settings for the control word there.
> 
> 
> -- 
> Peter Below (TeamB)

Thank you, Peter, that did the trick.

However, when I looked up the Set8087CW call on the Embarcadero site, it suggested using System.Math.SetExceptionMask instead, so I did.  

Thomas Bates
0
Thomas
11/28/2013 9:57:35 PM
Reply:

Similar Artilces:

How to use a delphi XE3 obj file in delphi 2007?
Hi, I'm migrating an application from delphi 2007 to delphi XE3 and I would like to do it in several steps. To do this I need to use a part of my new code (XE3) in the current delphi 2007 application. So I want to use the .obj file from my XE3 file. I know I have to use the {$L 'Filename'} and I know that I have to declare the functions that I want to use in external in my D2007 project. I wanted to make an easy and simple example to see how it works with only 1 function 'hello world' compiled in obj with XE3 but I can't find the way to use it in D2007. In D200...

Delphi 4 to Delphi 2007
Hello, I will have to port a D4 application (with source) to D2007. what kind of problem could I face ? I will have to go to customer site tommorow to analyse its source code to quote the work, what should I care of to hestimate the porting time ? Thanks John Terry wrote: > Hello, > I will have to port a D4 application (with source) to D2007. > what kind of problem could I face ? > I will have to go to customer site tommorow to analyse its source code > to quote the work, what should I care of to hestimate the porting time ? You can probably do it by just changi...

Delphi 2007 to Delphi 7
I've written a class in Delphi 2007 that is not supported in Delphi 7. What would be the best way to achive what I've done in Delphi 2007 in Delphi 7? Thanks, Tom type BondConstants = class { Bond Types } type BondType = record const TREASURY = 3; AGENCY = 0; CORP = 1; MUNI = 2; SBA = 5; MBS = 4; CMO = 6; end; { Day Count Methods } type DayCount = record const ACTUAL_360 = 2; ACTUAL_365 = 1; ACTUAL_ACTUAL = 1; d30_360 = 0; ...

Delphi 2010 can't upgrade Delphi 2007 projects
If I open any of my Delphi 2007 projects in Delphi 2010 it prompts me that it will upgrade it. Unfortunately, that leaves Delphi 2010 to give errors about not knowing where to find system and other core units. On the other hand, if I delete all the BDS project files and only leave the .dpr, Delphi 2010 can successfully open and compile my project. However, besides that quirk, I have another problem. I need to have both a working Delphi 2007 project and Delphi 2010, so I can compile using both without being prompted each and every time about upgrading project :) So... Any ideas to what m...

Delphi and Delphi for .Net
It seems that Delphi for .Net is slower than Delphi Win32 native applicaiton. I would like to know is it true all .Net application is slower than Win32 native applicaiton or it is Delphi for .Net only. Your information is great appreciated, Inung On 2011-06-21 18:20:17 +0100, Inung Huang said: > It seems that Delphi for .Net is slower than Delphi Win32 native applicaiton. > I would like to know is it true all .Net application is slower than > Win32 native applicaiton or it is Delphi for .Net only. If you are only running the code in the application once then, yes, yo...

Delphi XE3 plus CBuilder XE3 demo is still Delphi only
Have Delphi XE3 installed (and registered), tried to install the CBuilder XE3 demo to see if it work as required. The result is that only Delphi was updated and no CBuilder available. Is there a way to test it - I would have upgraded to full RadStudio but doubted the CBuilder 64 bit compiler would be available in time (deadline is almost here and already ported the code to VC++ but don't particularly like it). ...

Moving from Delphi 7 to Delphi 2007
Is there any compelling reason to move (quite a large project) from Delphi 7 to Delphi 2007? Specifically, is there better Vista/Win7/Win8 integration provided by Delphi 2007? (In the project I am already using a custom manifest file for Vista/Win7 etc.. and not the std XPMan component) Does 2007 add any new bugs to the scene? Thanks Rael Rael wrote: > Is there any compelling reason to move (quite a large project) from > Delphi 7 to Delphi 2007? If you are going to upgrade, why not upgrade to something newer? > In the project I am already using a custom man...

Delphi 2010 professional to Delphi XE3
Hello, Sorry for this is not right place to ask this question: I have Delphi 2010 professional version, I like to upgrade to Delphi XE3 Am eligible to upgrade or no not? I like answer from Delphi sales team. I couldn’t find email to ask them. Thanks Mike Thomas <> wrote in news:506459@forums.embarcadero.com: > Hello, > > Sorry for this is not right place to ask this question: > I have Delphi 2010 professional version, I like to upgrade to Delphi > XE3 Am eligible to upgrade or no not? I like answer from Delphi > sales team. I couldn’t find emai...

Delphi 2009 alongside Delphi 2007
Hi all, I am about to install Delphi 2009 on the same development system as Delphi 2007, before I embark is there anything I should be aware of so as to not break my Delphi 2007 installation and projects ? Thanks JT John Taylor wrote: > Hi all, > > I am about to install Delphi 2009 on the same development system > as Delphi 2007, before I embark is there anything I should be aware > of so as to not break my Delphi 2007 installation and projects ? As long as you install into a separate folder there is no problem with the two versions getting into each other...

Delphi 2007 to Delphi 2009 Conversion
CharArrayPtr = ^CharArray; CharArray = array[0..MaxInt-1] of Char; How to convert to Delphi 2009? Bill Bill Miller wrote: > CharArrayPtr = ^CharArray; > CharArray = array[0..MaxInt-1] of Char; > > How to convert to Delphi 2009? > > Bill it depends heavelly on how it is used fearther down in your project and what you want to convert it to. I you want to simple convert the declarations ignoring UNicode altogether then the only think you have to change is the CharArray declaratin from a Char to an AnsiChar eg CharArrayPtr = ^CharArray; CharArray =...

Delphi 2010 w Delphi 2007
I have D2007 installed on my laptop (XP sp3 running on dual core Athlon). Can I install D2010 on this machine without it affecting D2007? Will D2010 affect D2007 in any way? Thanks, Randall Carpenter > {quote:title=Randall Carpenter wrote:}{quote} > I have D2007 installed on my laptop (XP sp3 running on dual core Athlon). > Can I install D2010 on this machine without it affecting D2007? Will D2010 > affect D2007 in any way? Won't hurt a thing. I have D7, RAD Studio 2007, RAD Studio 2009, and RAD Studio 2010 all on my desktop system and they coexist fine. Jus...

Migrating from Delphi 7 to Delphi XE3
Hello, Its time to leave the old Delphi 7 and move to the new (but not the latest) XE3. I was wondering if there is a good book or reference to learn all new things XE3 added. Any suggestions? On 5/3/2013 10:17 PM, George Karatsiolis wrote: > Hello, Its time to leave the old Delphi 7 and move to the new (but not the latest) XE3. > I was wondering if there is a good book or reference to learn all new things XE3 added. Try this one for starters: http://tinyurl.com/cgsu243 Aside from that you really need to evaluate your application. XE3 is Unicode for example.... So her...

Delphi 2007 RTL in Delphi 7
I read somewhere that it is possible to use Delphi 2007's (or for that matter Delphi 2006's) RTL in Delphi 7 by just recompiling the source of RTL. Is this really possible? What are the benefits that we can derive using a higher version's RTL? TIA Yogi Yang Yogi Yang wrote: > I read somewhere that it is possible to use Delphi 2007's (or for > that matter Delphi 2006's) RTL in Delphi 7 by just recompiling the > source of RTL. If it actually compiles in Delphi 7, I guess it would be possible. OTOH, if one has Delphi 2007 already, I don't s...

Upgrading to Delphi 2009 from Delphi 5
I've decided it's time to upgrade to Delphi 2009 Professional from my current Delphi 5 Professional which (according to the FAQ) makes me eligible for the upgrade pricing. However, I'd just like to clarify how this process works. My concern is that my Delphi 5 is not registered on the CodeGear site and this doesn't seem to be possible as far as I can tell. When installing the trial I noticed that Delphi 2009 registers itself with your CodeGear account so does this mean that the previous version must be registered there to verify you own a Professional edition? I plan to o...

Web resources about - ArcGIS runtime errors after upgrading from Delphi 2007 to Delphi XE3 - embarcadero.delphi.ole

Facebook Starts Upgrading Profiles To Timeline
A couple of readers told us that timeline previews have kicked in on their profiles without their having initiated the change themselves. A welcome ...

Facebook Upgrading “Insights” Metrics Dashboard for Page Managers Tonight
Facebook has just begun pushing an upgrade to its “Insights” metrics dashboard for Facebook Pages that gives administrators more visibility into ...

Flickr: Help: Free Accounts, Upgrading and Gifts
Flickr is almost certainly the best online photo management and sharing application in the world. Show off your favorite photos and videos to ...

Mac Spoofed: Upgrading [Low Quality]
PC teaches Mac about the benefits of upgradability.

Coalition's NBN will need ongoing, costly upgrading, experts warn
The Coalition's planned broadband infrastructure will "freeze" broadband speeds, and need ongoing and expensive upgrading to resemble the system ...

Beware of unintended and costly consequences when upgrading houses
Meeting the Building Code measures on energy efficiency is a potentially tricky business, even if you are upgrading or extending only one part ...

Nuclear states still upgrading stocks
Nuclear armed states continue to upgrade their stockpiles despite s trend towards global disarmament.

Looks like Labor's upgrading from Tarago to minibus
The people of Stafford have done the rest of Queensland a favour by electing Dr Anthony Lynham.

Promise check: $16m towards upgrading Hobart's Cadbury factory
Keep track of the Coalition's promise to spend $16 million on upgrading Hobart's Cadbury chocolate factory.

Upgrading IOIO to Bluetooth - YouTube
An instructional video showing how to upgrade IOIO's firmware in order to make it Bluetooth capable. Downloads are at: https://github.com/yt ...

Resources last updated: 12/4/2015 2:36:04 AM