How to setup MS Visual Studio project properties for use with the Altia API

If you need to develop your MS32 application using MS Visual Studio, you have to setup the environment. You can follow steps below:

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.

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>

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.

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\ms32.

C:\usr\altia\libfloat\ms32 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\ms32\liblan.lib)

STEP 16

Click on Apply button to apply and then click on OK button to confirm.

STEP 17

Now you are able to build your application.

 







Have more questions? Submit a request

0 Comments

Article is closed for comments.