Custom components in 64-bit C++ Builder (creating standalone executable) [Edit]

As stated http://docwiki.embarcadero.com/RADStudio/XE3/en/C%2B%2BBuilder_64-bit_Windows_Differences#Producing_64-bit_Packages_Not_Supported , creating 64-bit packages (meaning installing custom components for 64-bit target) isn't yet supported in C++ Builder. But as creating and using 64-bit libraries is supported, is possible to use custom components in standalone (without runtime packages) 64-bit executable too.

There is our temporay solution, maybe useful for someone else too:
* create 32-bit component package,
* create parallel 64-bit library project (New, Other, Static Library) that contains runtime code of same components and has same name as 32-bit package (meaning it should be reside in different directory); set proper (intermediate, hpp and) final target directories for this project,
* in final project, add both 32 and 64-bit targets, but use IDE designer in 32-bit target activated mode (works because IDE is 32bit),
* add previously created 64-bit library directory to final project 64-bit target library directories (and maybe intermediate/hpp directories should added to appropriate directories too) : now should be possible to build 64-bit final project...
0
Hanno
1/9/2013 12:33:21 AM
embarcadero.cppbuilder.using 1848 articles. 1 followers. Follow

4 Replies
1650 Views

Similar Articles

[PageSpeed] 56

Hanno Nagland wrote:
> As stated http://docwiki.embarcadero.com/RADStudio/XE3/en/C%2B%2BBuilder_64-bit_Windows_Differences#Producing_64-bit_Packages_Not_Supported , creating 64-bit packages (meaning installing custom components for 64-bit target) isn't yet supported in C++ Builder. But as creating and using 64-bit libraries is supported, is possible to use custom components in standalone (without runtime packages) 64-bit executable too.
> 

This part "(meaning installing custom components for 64-bit target)" is actually 
meaningless.  The IDE remains a 32bit ide, you can only install 32 bit packages, 
you can not install 64 bit packages even if built with Delphi.  At design time 
you are always working with 32 bit versions of components, at link time you link 
in the 64 bit obj files.  Your target during design time will not matter.

-- 
Jeff Overcash (TeamB)
       (Please do not email me directly unless  asked. Thank You)
And so I patrol in the valley of the shadow of the tricolor
I must fear evil. For I am but mortal and mortals can only die.
Asking questions, pleading answers from the nameless
faceless watchers that stalk the carpeted  corridors of Whitehall.
              (Fish)
0
Jeff
1/9/2013 2:11:58 AM
> {quote:title=Jeff Overcash (TeamB) wrote:}{quote}
> This part "(meaning installing custom components for 64-bit target)" is actually 
> meaningless. The IDE remains a 32bit ide, you can only install 32 bit packages, 
> you can not install 64 bit packages even if built with Delphi.  At design time 
> you are always working with 32 bit versions of components, at link time you link 
> in the 64 bit obj files.  
Let's say "using custom components in 64-bit target" then
> Your target during design time will not matter.
It matters in C++ Builder XE3 (tested Trial with SP1): when active target platform is set to 64-bit during design-time, 32-bit-only custom components are "greyed out" (as it should be) in Tool Palette and in Ide Insight too, eg you cannot add them to your form...
0
Hanno
1/9/2013 11:37:13 AM
> {quote:title=Hanno Nagland wrote:}{quote}
> It matters in C++ Builder XE3 (tested Trial with SP1): when active target platform is set to 64-bit during design-time, 32-bit-only custom components are "greyed out" (as it should be) in Tool Palette and in Ide Insight too, eg you cannot add them to your form...

That means the compiler directive is not correctly setup for the component. (this is the same for Delphi)

[ComponentPlatformsAttribute(pidWin32 or pidWin64)] 


http://docwiki.embarcadero.com/RADStudio/XE3/en/64-bit_Cross-Platform_Application_Development_for_Windows

"Making Your Components Available at Design Time and Run Time

Following are the two ways the IDE decides whether or not a component is available for Win32/Win64/OSX32. (Here "available" means appearing on the palette, and checked by the IDE. The IDE does not do any compile-time checking other than verifying the existence of component unit.) Both methods described here rely on data embedded in the Win32 run-time (or design+run-time) package that implements the components. The IDE cannot load Win64 and OSX32 packages in the IDE, so the IDE must defer to the Win32 pack
age for information.

The RAD Studio build system automatically embeds an RC_DATA resource in the Win32 package binary named PLATFORMTARGETS, which is a bitmask of the pidXXX constants in System.Classes.pas and reflects the package project's targeted platforms. The IDE reads this when the package is loaded and uses it to decide, for example, whether or not to disable the component(s) in the palette when an unsupported platform is active.

Targeting multiple platforms with a component package implies a contract between the component developer and the IDE. The IDE assumes that if a component package project targets multiple platforms and the developer distributes the Win32 run-time package to customers (and all the associated compilable and linkable files), the developer will also distribute all the necessary compilable, linkable, and run-time bits for the other targeted platforms as well.
Individual components can use the ComponentPlatformsAttribute class attribute to override the data in PLATFORMTARGETS, using a bitmask of the same constants in the Classes unit. For example:

type
  [ComponentPlatformsAttribute(pidWin32 or pidWin64)] // not supported on OSX
  TMyComponent = class(TComponent)
  private
    ...
  end;
Use of the ComponentPlatformsAttribute attribute implies the same contract as described in the first bullet above."

If that style attribute is not available in C++ Builder, you should be able to make an intermediate Delphi parent class that basically just defines that and then inherit from it instead of the original parent.
0
Jeff
1/9/2013 3:29:36 PM
Hi,

> {quote:title=Hanno Nagland wrote:}{quote}
> * create parallel 64-bit library project (New, Other, Static Library) that contains runtime code of same components and has same name as 32-bit package (meaning it should be reside in different * 
> directory); * 

   Does this will work with a dll instead of a static library as parallel 64-bit project ?

Thanks in advance
NF
0
Nicolas
5/10/2013 4:07:26 PM
Reply:

Similar Artilces:

Custom component 64 bit [Edit]
I have a custom component compiled on target platform Win32, everything works fine. For Win64bit application it needs 64bit-compiled component. In doc is written simply create 32bit and compile and next set Target platform to 64bit and compile. When i open the package with component, in Project manager/Add platform there is NO selection for 64-bit windows( only OSX and 32bit win). When i create application, there IS a selection 64-bit in Project manager/Add platform. Linker needs "package.a" library instead of "package.lib" but how to create "package.a"? What ...

Using C++ Code in Delphi XE4 64-bit [Edit]
I am interested in using C++ code in a Delphi XE4 Pro 64-bit app (no iOS, I did not want to pay the "nominal fee", at least not yet). I don't want to use a DLL, I want to link the C++ right into the 64-bit EXE. It is not easy finding info on this online, there's some stuff but not enough to answer all my questions. 1) Do I need to use C++ Builder 64-bit to create object files that can be linked via $LINK in Delphi XE4 64-bit? Or can I create them using Visual Studio? 2) Do I need to "flatten out" C++ classes in order to share them with Delphi or to share them ...

XE3, C++ Builder, GetHitTestInfoAt not works correctly under 64 bit [Edit]
Hi, The following code works on Win32 target, but not works on Win64 target. On Win64 target never reach the, {code} clicked_item = pItem; {code} line, when I click on the tree view item. {code} void __fastcall TfMainForm::tvBrowserMouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y) { _browser_mousedown( Sender, Button, Shift, X, Y ); } void TfMainForm::_browser_mousedown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y) { TTreeNode* pItem; THitTests HT; AnsiString text_label; int idx, old_idx; ...

Having problems with Components that use other Custom Components [Edit]
I need to understand how the components work and interact with each other better. I have three components that I have created for my software so they can be included in a bunch of related applications. Host.bpl - Low level Disk I/O, Licensing, INI file functions, encryption, etc. Database.bpl - Database functions for many different databases Resource.bpl - GUI level functions. Any visual components My Database component uses the Host component for some of its functions My Resource component uses the Host and Database component functions All I need to place on my high level applicati...

C++ Builder XE4: Need to upgrade a custom widget for 64-bit compile
Ten years ago I subclassed TStringGrid to create a widget that added a few features I needed. I've installed this widget into XE4, and it works fine for 32-bit builds. But now I'm rewriting the product, and it needs to be published in both 32- and 64-bit versions. This would work fine if I could figure out how to make a 64-bit version of my widget, but I'm stumped. In C++ Builder XE4, if I select Component->New and create a new project, my only compiler options are 32-bit and OSX. Same thing if I use File->New->Other and choose Package from the project types list. ...

New-blank 64 bit C++ Builder XE3 VCL Application
I just installed C++Builder XE3 tonight, with 64 bit support. I created a new project. I built it. And ran it. It built and ran fine. (32 bit). Then I added a 64-bit windows target platform. Instead of it building, it complained it couldn't find the vcl.bpi and rtl.bpi, and even though they are both in the same folder and I clicked "remember this folder", it asked me twice to find the .bpi files that should have been in the default lib/bpi folders. Then, if that wasn't annoying enough, it couldn't find any of the headers when I built in 64 bit mode. I had to find...

Real 64-bit compiled perl on HPUX 11.11, using proper ANSI 64-bit capable C compiler
I'm using the latest stable release (5.6.1), and perl compiled in 64-bit mode on HPUX (yes, I passed the correct parameters to Configure). It fails a couple of routines under the test suite (numconvert and b). I also read the README.hpux, and saw the rather disheartening remark in there about 64-bit compiled perl and perl not being fully 64-bit compliant yet. However, I'm kindof stuck, because I need to build Sybase extensions onto my perl, and as of Sybase 12.5 I only get 64-bit libraries, no more 32-bit libraries ... This can be a major show-stopper, and although I...

Using a component from c++ builder
Hi: I have a component I wrote in c++Builder, how can I reuse this component in delphi? This component is non-visual and is not on any pallet--if this makes a difference! Any help apreciated. Sean. Hello, you can't use C++ code from Delphi. You could however declare an interface or an abstract base class in Delphi and derive your class from it. -- Moritz "Hey, it compiles! Ship it!" ...

C++ 64 bit [Edit]
I just succeded in getting XE3 running. The most interesting feature is the ability to use a 64-bit address space. The Delphi documentation suggests that one set the <Target Platform> setting to 64-bit Windows. This exists and probably would work, if I knew Delphi. The C++ compiler was advertised to support 64 bit windows as well. But the <Target Platform> selection set in the C++ projects seems to lack the 64-bit Windows Option. I check the VCL and FireMonkey target sets. I can'f find any document ation. Am I missing something? My question is: How does one designate...

Probable Stupid Question: Using 64-bit Code on 64-bit Processors running 32-bit Windows...
Hi, Does anyone know if it is possible to do 64-bit processing (probably by writing some assembly language code) when running on a 64-bit CPU under 32-bit Windows? As near as I can tell, one has to develop all 64-bit code on a 64-bit machine running 64-bit windows and the target machines for 64-bit code have to be 64-bit machines running 64-bit windows. What might be useful, if it is possible, would be being able to detect a 64-bit processor when running 32-bit windows and take advantage of that to speed up some calculations. DanH ...

How Can I use the compliers used under Dev-C++ in C++ builder?
How Can I use the compliers (for instance GCC, ...) used under Dev-C++ in C++ builder? In my program,I used boost lambda expression under Dev-C++ due to the fact that C++ builder 2009 do not support such expression. But Dev-C++ do not support RAD(rapid application development). It is hard to establish the common graphic GUI under windows.So I want to use the compliers of Dev-C++ in C++ builder. And I do not know how to manage it. Where can I get the related materials or advices? Can any one with kindness help me? Il Tue, 11 Aug 2009 23:29:59 -0700, lserjt lserjt <> ha scritto:...

Probable Stupid Question: Using 64-bit Code on 64-bit Processors running 32-bit Windows... #2
Hi, Does anyone know if it is possible to do 64-bit processing (probably by writing some assembly language code) when running on a 64-bit CPU under 32-bit Windows? As near as I can tell, one has to develop all 64-bit code on a 64-bit machine running 64-bit windows and the target machines for 64-bit code have to be 64-bit machines running 64-bit windows. What might be useful, if it is possible, would be being able to detect a 64-bit processor when running 32-bit windows and take advantage of that to speed up some calculations. DanH Dan Hale wrote: > Does anyone k...

Create a production build of Firefox for Microsoft 64-bit OSs (Vista 64, MS Windows 2008 Server 64-bit)
Name: Dmitry Viazmin Email: dmitrydotviazminattutdotby Product: Firefox Summary: Create a production build of Firefox for Microsoft 64-bit OSs (Vista 64, MS Windows 2008 Server 64-bit) Comments: Hi, It would be great to get a production build of Firefox for Microsoft 64-bit OSs (Vista 64, MS Windows 2008 Server 64-bit). Do you plan to do that? Best Regards, Dmitry Viazmin Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3 From URL: http://hendrix.mozilla.org/ Note to readers: Hendrix gives no expectation of a...

How to create the component in C++BuilderXE2 [Edit]
Hello developers, I need your help please. I have the .h file with my own class(with all needs for component, __properties and etc), I want to make from this header component, but I don't know how to do it... Can any one explain me how to create component from .header file? thx ... Edited by: Kakha Amashukeli on Dec 15, 2011 5:43 PM Edited by: Kakha Amashukeli on Dec 15, 2011 6:38 PM Kakha wrote: > Hello developers, I need your help please. I have the .h file with my > own class(with all needs for component, __properties and etc), I want > to make from this header com...

Web resources about - Custom components in 64-bit C++ Builder (creating standalone executable) [Edit] - embarcadero.cppbuilder.using

Component - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

AirAsia disaster: Indonesia cites faulty component, crew response in crash
Pilots appear to have reset the computer system's circuit breaker, leading to a series of failures that caused them to lose control of the plane ...

Teardown of iPad Pro reveals revamped component layout
... Apple device teardown on the iPad Pro on Wednesday, revealing a reworked internal design dominated by massive batteries and bespoke audio components. ...

Corvette Stingray gets optional Z06 components
Filed under: Chevrolet , Coupe , Performance Chevrolet announces a series of upgrades available for the Corvette Stingray derived from the equipment ...

Samsung reportedly lost key iPhone 7 component business
... for Samsung , which is ironic considering the two companies are fierce rivals in the mobile business. The Korean giant produces various components ...

Crew, faulty component caused AirAsia crash
Indonesian investigators said crew action and a faulty component caused the AirAsia jet crash in the Java Sea last year, killing 162 passengers. ...

IDG Contributor Network: Four critical patches for November Patch Tuesday update core Windows and Office ...
Microsoft's November Patch Tuesday brings us four critical updates and eight important patches that attempt to resolve 54 reported vulnerabilities ...

Immigration Law Enforcement: A Vital Component Of National Security And Counterterrorism
While the administration claims that these refugees are being vetted, there is no way to actually screen these people

Taiwan panel makers calling on China government for component tariff reductions
Panel makers in Taiwan are calling on the China government to allow for zero tariffs on panel components due to Taiwan's weakening panel supply ...

Teflon Component Tied to Kids' Weight Gain
PFOA, a main component of Teflon, has been linked to increased body fat and faster weight gain in children.

Resources last updated: 12/17/2015 4:45:21 PM