Getting started with STK 11.4 and Windows Forms Applications
- May 7, 2018
- Tech Tip
STK 11 was the first version of Systems Tool Kit (STK) that included a 64-bit version along with the 32-bit version.
The newly released STK 11.4 is the first STK release that contains only the 64-bit version.
A vast majority of our customers are using the Microsoft Windows 64-bit operating system. One application that is still only 32-bit is Microsoft Visual Studio. As a 32-bit application, Visual Studio does not recognize 64-bit controls, such as STK globe and map controls.
The controls replicate STK’s 3D and 2D windows and the customers who build custom applications using C# or vb.net require those controls for visualization. Technical Support had two workarounds for customers who had only 64-bit STK installed. One workaround was to modify the designer source file, but because the files contain a large banner on the top that says “do not modify”, a majority of users were not comfortable with this solution. The other workaround was to install the 32-bit version of STK on the computer. My colleagues in Technical Support and I preferred the second approach as well.
So, needless to say, I was pretty panicked when I found out that the approach will no longer be valid with the release of STK 11.4. I begged and pleaded with development to implement an alternative approach to the problem. They stepped up to the plate and now we have a simple method to add STK controls to the Visual Studio Windows form application.
The method is well documented in our Programming Interface help, but I wanted to highlight key steps that are different in the new version:
- When adding references, you need to use the Browse button, navigate to
\bin\Primary Interop Assemblies, and add references manually.
- Once references are added manually, you need to change the “Embed Interop Types” property to false for each dll.
- In Designer, adding the controls to the Toolbox is accomplished by browsing to the same directory under .net tab, and selecting AGI.STKX.Controls.Interop.dll.
As always, if you are using Visual Studio 2013 and later, make sure that "Prefer 32-bit" option is unchecked in the Project's build settings.