You can configure Visual Studio to build a .NET application using the 64-bit engine for an existing project or a new project.
The STK Engine code samples that ship with the STK 32-bit install can be used with both the 32-bit and 64-bit versions of STK. The Visual Studio solutions have both x86 and x64 configurations. Based on the configuration you select, the examples use the corresponding version of STK Engine. If you try to use a configuration for which the corresponding version of engine is not installed on your machine, the following message is displayed at startup:
If you get this message, please make sure you selected the correct configuration for the version of STK/STK Engine installed.
To use the 64-bit version of STK Engine in your Visual Studio C# or VB.NET project, select the configuration to Any CPU, and then rebuild your application. If the Any CPU configuration is not already available in your solution:
If the STK 32-bit version is installed side by side with the 64-bit version, creating a new project is similar to the steps used for the 32-bit application. You can follow the steps described in the existing 32-bit tutorials. Then switch the build configuration to Any CPU as indicated above.
It is a little bit more complicated if the 32-bit version of STK is not installed. In this case, dragging and dropping an STK Engine control from the Visual Studio toolbox is not going to work. Basically, Visual Studio is a 32-bit application, and the designer cannot use 64-bit controls (this issue is described on MSDN KB963017 – see http://support.microsoft.com/kb/963017 ). So if you still want to use the designer, you must install the 32-bit version of STK Engine. Another workaround is to skip the toolbox/designer and instantiate the controls manually yourself in code.
For example:
private AxAGI.STKX.AxAgUiAxVOCntrl axAgUiAxVOCntrl1; private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); this.axAgUiAxVOCntrl1 = new AxAGI.STKX.AxAgUiAxVOCntrl(); ((System.ComponentModel.ISupportInitialize)(this.axAgUiAxVOCntrl1)).BeginInit(); this.SuspendLayout(); // // axAgUiAxVOCntrl1 // this.axAgUiAxVOCntrl1.Dock = System.Windows.Forms.DockStyle.Fill; this.axAgUiAxVOCntrl1.Enabled = true; this.axAgUiAxVOCntrl1.Location = new System.Drawing.Point(0, 0); this.axAgUiAxVOCntrl1.Name = "axAgUiAxVOCntrl1"; this.axAgUiAxVOCntrl1.OcxState = ((System.Windows.Forms.AxHost.State) (resources.GetObject("axAgUiAxVOCntrl1.OcxState"))); this.axAgUiAxVOCntrl1.Size = new System.Drawing.Size(427, 342); this.axAgUiAxVOCntrl1.TabIndex = 0; ...
STK Programming Interface 11.0.1