STEP 1
Open MS Visual Studio, on the File menu, point to New, then click Project…
From the Visual C++ project types, click Win32, then click Win32 Console Application. (Yes, you select Win32 even though you are building a 64-bit client.
STEP 2
In the Edit Boxes placed in the bottom part of the New Project dialog window, set the Name of the project, the Location Folder and the Solution name.
STEP 3
Click on Next button in the first dialog Wizard that summarize your project settings.
STEP 4
In the Application Setting wizard add a flag in the Empty project check box. Application type shall be Console application
STEP 5
Select Finish button
STEP 6
The MS Visual Studio IDE environment opens itself. You can see the project tree folder in the left panel.
STEP 7
Right click on Source Files folder in your project tree and select Add -> New Item... in the pop-up menu to add a new C file or select Add -> Existing Item... to add an already available C file.
STEP 8
If you added a new C file, you can insert your code.Below an example.
#include <stdio.h>
#include <altia.h>
//If you are using VS2015 or later, uncomment the following
//#ifdef _WIN64
//FILE iob[3];
//FILE * __iob_func(void)
//{
// iob[0] = *stdin;
// iob[1] = *stdout;
// iob[2] = *stderr;
// return iob;
//};
//#endif
int main(int argc, char *argv[])
{
AtConnectId connectId;
if ((connectId = AtOpenConnection(NULL, NULL, argc, argv)) < 0)
{
printf("AtOpenConnection failed !\n");
}
AtSendEvent(connectId, "move", (AltiaEventType)0);
AtSendEvent(connectId, "move", (AltiaEventType)100);
AtCloseConnection(connectId);
return 0;
}
STEP 9
Select Menu Project -> <your_project> Properties... (<your_project> is your project name), the Project Property dialog will appear.
STEP 10
Project Property dialog:
In the Configuration: pop-up select All Configurations so the new settings will be applied to Release and Debug configurations.
In the Platform: pop-up select x64 so the new settings will be applied to the 64-bit builds.
STEP 11
Project Property dialog:
In the Left panel select:
Configuration Properties
> General
In the Right panel set Character Set = Use Multi-Byte Character Set
STEP 12
Project Property dialog:
In the Left panel select:
Configuration Properties
> C/C++
> General
In the Right panel set Additional Include Directories = C:\usr\altiaXXX\libfloat\ms64.
C:\usr\altia\libfloat\ms64 is the folder containing the Altia library and the Altia header file.
STEP13
Project Property dialog:
In the Left panel select:
Configuration Properties
> C/C++
> Code Generation
In the Right panel set Runtime Library = Multi-threaded (/MT).
STEP 14
Project Property dialog:
In the Left panel select:
Configuration Properties
> Linker
> Input
In the Right panel set Ignore Specific Default Libraries = libc.lib
STEP 15
Project Property dialog:
In the Left panel select:
Configuration Properties
> Linker
> Input
In the Right panel add in the Additional Dependencies the Altia library path (example : c:\usr\altia\libfloat\ms64\liblan.lib)
NOTE: If you are using VS2015 or later you also need to add legacy_stdio_definitions.lib in this area.
STEP 16
Click on Apply button to apply and then click on OK button to confirm.
STEP 17
Ensure that your build configuration (in the main menu bar) is set to x64. Now you are able to build your application.