< Back To ASN1C Support

Using ASN1C with Existing Visual Studio Project Files

Visual Studio Projects

ASN1C comes complete with several samples, each of which includes a Visual Studio project file compatible with Visual Studio 2010. (These project files may be imported into newer versions of Visual Studio.) ASN1C versions 6.0 and above also include options to generate project files.

This tutorial describes creating a project file for the Employee sample program found in ASN1C_INSTALL_DIR\cpp\sample_ber\employee. On typical Windows installations, ASN1C_INSTALL_DIR is c:\acv[version], where [version] corresponds to the three digit version number, such as 703.

Following are instructions for using the enclosed project files.

  1. Before working with the project, the source code for it must be generated, either using the command-line tool or the graphical user interface. Also, the "nmake" command can be used from a Visual Studio 2010 command window after using the "cd" command to change the "employee" directory.
  2. Open Microsoft Visual Studio (2010 or higher). The details of using a version of Visual Studio newer than 2010 may be slightly different from those presented below.
  3. From the File menu, choose "Open->Project/Solution..."
  4. Open the file employee_Writer.vcxproj.
  5. If you expand the Header Files and Source Files filters, you should see the source files that comprise the writer project.
  6. Click on the Save All button (the one with multiple disk pictures). Visual Studio will prompt you to save a .sln (solution) file and will suggest the name employee_Writer.sln. Change this name to employee.sln and save the file.
  7. Right click on "Solution 'employee' " and choose "Add->Existing Project...". Choose the file employee_Reader.vcxproj.
  8. Right click on the employee_Writer project and select "Set As StartUp Project".
  9. Select "Build->Build employee_Writer from the menu bar. This action will compile the writer executable.
  10. Click on the employee_Reader project.
  11. Select "Build->Build employee_Reader" from the menu bar. This action will compile the reader execucatble.
  12. Select "Debug->Start Without Debugging" from the menu bar. A Visual Studio terminal window will open, and you will see the content of the writer's execution. Close this window by pressing any key.
  13. Right click on the employee_Reader project and select "Set As StartUp Project".
  14. Select "Debug->Start Without Debugging" from the menu bar. A Visual Studio terminal window will open, and you will see the contents of the reader's execution. Close this window by pressing any key.