Home Page > KernelCAD Components > 64 bit development
64 bit support
Support for 64 bit development
64 bit apllications are supported by x64 editions of KernelCAD products starting from the version 4.3.
Due to the fact that there is no full 64 bit version of Microsoft Visual Studio
available, 64 bit applications have limited functionality in design mode (form
editors). One limitation is that the 3D view of the actual model is not
displayed in design mode (in runtime all works as expected). Another limitation
is that embedding model into x64 applications is not supported starting from
v4.3. These limitations will be removed as soon as Microsoft releases a 64 bit
Visual Studio. We expect it should be available in 2014-2015.
Most of KernelCAD interface works seemlessly in 32 and 64 bit environments. Some
of the interfaces have to be modified to be used for 64 bit development. See the
next section. Apart from the interfaces below in the future new interfaces are
intended to be bitness-independent
Interfaces specific to 64 applications
The interfaces listed below are 64 bit counterparts of the correspondent 32
interfaces:
Upgrading to 64 bit environment
If an existing 32 bit application has to work in both 32 and 64 bit environment
consider using constructs like (VB .NET):
#If KC_X64 Then
Dim m_iDetector As IKCPathCollisionDetector64
Dim m_iMetrics(1) As IMetrics64
Dim m_iKinematicSet As IKinematicSet_KC64
Dim pos As Long
#Else
Dim m_iDetector As
IKCPathCollisionDetector Dim m_iMetrics(1) As IMetrics
Dim m_iKinematicSet As IKinematicSet_KC Dim pos As Integer
#End If
The KC_X64 (or similar) constant can be added as a Conditional
Compilation Symbol to project properties (Build page in Visual Studio C# project
properties). See Samples\NET\VB\Collision\CollisionPath\CollisionPathForm.vb for an example
C# language has a slightly better construct:
#region KCDefines
#if KC_X64
using POSNT = Int64;
using IIteratorT = IIterator64;
using IListT = IList64;
#else
using POSNT = Int32;
using IIteratorT = IIterator;
using IListT = IList;
#endif
#endregion
Which can be compacted into a single line as a collapsed region on the top of
each file using the interfaces. See the paragraph below and
Samples\NET\C#\Collision\CollisionPath\CollisionPathForm.cs
Native C++ applicaations can just replace IIterator with IIteratorT or similar.
The IIteratorT is already defined in Samples\VC\Include\TDefs.h to compile
without any other changes with or without the 64 suffix depending on the current
compiler configuration.The list position type used in the above interfaces is
also defined in generic way as POSNT type which is mapped to
int in 32 bit and to __int64 in 64 bit environments.
|