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 D2007 I used the {$L 'Filename'} and declared the function external but the D2007 project doesn't start if in my code I call this function. If I comment the line containing the function in my code the application starts normally but if there is this function it compiles but doesn't start at all (also with the dcu's debug and launching it with F7).

Can anybody give me some tips on how to use the obj's in my D2007 project?

Regards
0
Alain
6/19/2014 11:55:17 AM
embarcadero.delphi.non-tech 5933 articles. 1 followers. Follow

6 Replies
985 Views

Similar Articles

[PageSpeed] 41

Am 19.06.2014 13:55, schrieb Alain MILANDRE:
> 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 D2007 I used the {$L 'Filename'} and declared the function external but the D2007 project doesn't start if in my code I call this function. If I comment the line containing the function in my code the application starts normally but if there is this function it compiles but doesn't start at all (also with the dcu's debug and launching it with F7).
> 
> Can anybody give me some tips on how to use the obj's in my D2007 project?
> 
> Regards
> 

Hello,

you might get more and better answers if you ask this question over in
the compiler related newsgroups.

Greetings

Markus
0
Markus
6/19/2014 7:04:19 PM
> {quote:title=Alain MILANDRE wrote:}{quote}
> 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 D2007 I used the {$L 'Filename'} and declared the function external but the D2007 project doesn't start if in my code I call this function. If I comment the line containing the function in my code the application starts normally but if there is this function it compiles but doesn't start at all (also with the dcu's debug and launching it with F7).
> 
> Can anybody give me some tips on how to use the obj's in my D2007 project?
> 
> Regards

Years ago I enhanced a TPW 1.5 with Delphi 1 .... yeah I'm old ... anyway the way I did it then and how you could do it now is use a DLL for you new functionality ... you are going to have massive problems otherwise due to fundamental changes to Delphi around 2010 (double byte chars will be the big one)

--
Linden
"Mango" was Cool but "Wasabi" was Hotter but remember it's all in the "source"
0
Linden
6/19/2014 10:45:00 PM
Alain MILANDRE wrote:

> Can anybody give me some tips on how to use the obj's in my D2007
> project?

It's impossible in general: each new compiler generates version
specific code for classes, RTTI, etc, recent versions has new language
features which are not exist in older versions.

The only reliable way (as Linden said) is creation of DLL with
interface in POD ("plain old data") style.

--
Alex
0
Alex
6/20/2014 2:56:16 AM
> {quote:title=Alex Belo wrote:}{quote}

> The only reliable way (as Linden said) is creation of DLL with
> interface in POD ("plain old data") style.


There are more flexible possibilities: DLL's can also expose functions that return or expect interfaces, all of this without needing ActiveX. That way you can easily pass objects (tInterfacedObjects) between DLL's and executables. I do it all the time. It's also a great way for creating plugins. 

The only things to watch out for are :

  -only use automation-compatible data types (such as interface, widestring, integer, double, wordbool) in the interfaces. These data types make no assumption about the underlying memory manager and memory layout.
  -make sure that the DLL and the executable use identical declarations for the exposed interfaces (for example, by sharing a common declaration unit). 


Now if only Delphi DLL's weren't so absurdly bloated...Sigh.
0
Arthur
6/20/2014 7:07:49 AM
Hi everybody,

thanks for the tips, I will try with a DLL an see if I can do what I want.

Regards
0
Alain
6/20/2014 12:51:00 PM
Hi everybody,

thanks for the tips, I will try with a DLL an see if I can do what I want.

Regards
0
Alain
6/20/2014 1:06:05 PM
Reply:

Similar Artilces:

can i use delphi 2007 bpls in delphi 2009
can i use delphi 2007 bpls in delphi 2009 ? "Gaetan SIRY" skrev i meddelelsen news:8703@forums.codegear.com... > can i use delphi 2007 bpls in delphi 2009 ? No. -- Finn Tolderlund The compatiblity between D2006 and D2007 was unique. Normaly they can't be compatible because new version enhance/change the API. And D2009 defines String = Unicode where older version has String = Ansistring so D200x/Dx-BPL are 200% incompatible with D2009. ...

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; ...

MOVED: Use Delphi XE TLB importer in Delphi 2007?
....to the ActiveX group: https://forums.embarcadero.com/thread.jspa?threadID=47170 -- Craig Stuntz · Vertex Systems Corp. · Columbus, OH Delphi/InterBase Weblog : http://blogs.teamb.com/craigstuntz/ ...

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&#...

Is it posible to configure Delphi XE3 IDE to use Delphi 7 compiler/debuger
Hi! Like many other developer out there I have several project which has been developed with older version of Delphi (Delphi 7). Since theese projects rely on some components which are not compatible with newer versions of Delphi (no newer versions available) I'm forced to do any maintnance on theese projects using Delphi 7. Another solution would be to find replacment components which would provide me with same capabilities and work with latest versions of Delphi. But this would probbably require compleete rewritings of my projects (lots and lots of work). So currently I'm using...

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). ...

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...

Using Delphi 7 and Delphi 2010
I had a project in Delphi 7. I worked on it in Delphi 2010. When I try to open the .dpr again in Delphi 7, the IDE toolbar widens across both monitors, and Delphi 7 locks up. It appears that Delphi 2010 modifies the .dpr in a way that makes Delphi 7 unable to open it again. All my forms & units appear to open fine in D7 after D2010, except for the warnings on the ExplicitHeight and ExplicitWidth properties being missing... I can easily recreate the .dpr, but is this expected behavior? Thanks. Tom Field wrote: > I had a project in Delphi 7. > > I worked o...

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 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...

is there a Delphi 2007
Would be nice to have a bundle of the latest Delphi packages. Gilbert Padilla wrote: > Would be nice to have a bundle of the latest Delphi packages. > I expect Delphi 2007 will only be on sale until the full RAD Studio 2009 edition is published, including Delphi 2009.net. W ...

Migrate from Delphi 2007 to Delphi 2010
Hi All, Thanks in advance for your help. Below is my query, Currently I am using Delphi 2007 and i want to migrate to Delphi 2010. 1. What all things i need to take care while doing this? 2. What all third party components will get impacted? 3. Any known issues in Delphi 2010 which might impact the cause? 4. Any changes in database operation required as i am using Oracle? Hope I have post this query under correct category. If not sorry for the trouble and could you please suggest me the correct category for this? Looking forward for your response. Have a great day. Th...

Web resources about - How to use a delphi XE3 obj file in delphi 2007? - embarcadero.delphi.non-tech

Delphi - Wikipedia, the free encyclopedia
... an archaeological site and a modern town in Greece on the south-western spur of Mount Parnassus in the valley of Phocis . The site of Delphi ...

Delphi Automotive (@DelphiAuto) on Twitter
Log in Sign up You are on Twitter Mobile because you are using an old version of Internet Explorer. Learn more here Delphi Automotive @ DelphiAuto ...

Delphi Connect for Verizon on the App Store on iTunes
Get Delphi Connect for Verizon on the App Store. See screenshots and ratings, and read customer reviews.


Audi working with Delphi to develop autonomous car tech
Audi is developing an iPad-sized device that will pack all the necessary computing power for a self-driving car

Domestic firms eye Delphi
BizChina offers latest business and market information of China, online updates of 17 industries, investment guides, business events and industry ...

Verizon And Delphi Officially Launch Vehicle Diagnostics Service - $250 For The Module, $5 A Month On ...
If you're a car nut, a paranoid parent, or a small business owner looking to do a little, uh, company vehicle economy analysis, Verizon's teamed ...

Watch out Google: Delphi gives Ars a ride in its self-driving car
The automotive components maker gave Ars a preview ride around the neighborhood. MOUNTAIN VIEW, CA—On Thursday morning I met with Delphi at its ...

Official: Verizon's Vehicle Diagnostics by Delphi now on sale for $250
Filed under: Technology Partnering with Verizon Wireless, Delphi Automotive has released its Vehicle Diagnostics by Delphi product that allows ...

Delphi partners with WiTricity on automated wireless charging system
One could easily argue that parking between the white lines at any local hangout presents a challenge for some inexperienced drivers. So, why ...

Resources last updated: 2/13/2016 3:35:16 PM