Setting up a DSAPI project in Visual Studio 2005

March 06, 2008

...

The DSAPI is a very powerful feature of the Domino server where you can create filters that modifies the Domino web server’s behaviour when processing web requests. However, being a C/C++ API it is somewhat unaccessible to web developers like myself. (Personally, I haven’t done any C++ for 10 years). However, my experience is that the biggest hurdle is acutally to set up the development environment, not the development itself. After a bit of struggle, I was finally able to set up a project in Visual Studio 2005 so that I could develop my desired DSAPI filter. In order to (hopefully) save anyone else from having to waste precious development time struggling Vicious Studio, I have set up a project that you can download here. (Note that I have removed all Lotus C++ API header and library files from the project in order not to violate any copyright legislation. You need to download the Lotus C++ API Toolkit for Notes/Domino 7.0a package and then copy the necessary files into the Visual Studio project).

Basically what I did was creating a new Visual C++/Win32 Console application where I during the project creation wizard set application type to ‘DLL’ and checked the option to ‘export symbols’. Then I created a subdirectory on the file system which I named ‘dsapi’. I then copied the header files and the ‘notes.lib’ file from the Lotus C++ API Toolkit for Notes/Domino 7.0a distribution into two subdirectories of the ‘dsapi’ directory, ‘Includes’ and ‘Lib’, respectively. Furthremore, there was a lot of configuration properties that needed to be changed:

  • C/C++ -> Code Generation -> Runtime Library: Set it to ‘Multi-threaded (/MT)’.
  • C/C++ -> General -> Additional Include Directories: Added ‘$(ProjectDir)dsapiInclude’.
  • C/C++ -> Precompiled headers -> Create/User precompiled Header: Set it to ‘Not Using Precompiled Headers’.
  • C/C++ -> Preprocessor -> Preprocessor Defintions: Added ‘W32’ to the list of definitions.
  • Linker -> Input -> Additional Dependencies: Added ‘$(ProjectDir)dsapiLibnotes.lib’.

Once these steps have been done, the DSAPI module finally worked!


Profile picture

Written by Vidar Kongsli who is a software professional living in Oslo, Norway. Works as a consultant, system architect and developer at Bredvid. You should follow him on Twitter