This document is meant as a supplement to User functions page found at the CLIPS DLL site.

To build CLPUSRFN.DLL using AppWizard under VC++ 5.0, follow these steps :

  1. Click File | New and select MFC AppWizard(dll)
  2. Fill in the Project name as clpusrfn
  3. Click Finish and then click OK
  4. Click Project | Settings to open the Project settings dialog box. You could have also pressed Alt-F7
  5. Click the C/C++ tab and under the heading of Category select Code Generation
  6. Under Use run-time library select Multithreaded DLL
  7. Click the Link tab and under the heading of Object/library modules fill in the location of the file Clips.lib. This file is provided with the download of CLIPS.DLL
  8. Click OK to close the Project settings dialog box
  9. One file AppWizard will generate for you is clpusrfn.cpp. Place your version of UserFunctions here after the statement CClpusrfnApp theApp;
  10. You will also need to #include clips.h in clpusrfn.cpp. However, in order to avoid C++ name mangling you must enclose the #include in an extern "C" statement. For example,
    extern "C" {
    #include "c:\Clips\clipssrc\clips.h"
    }
  11. You MUST use the extern "C" directive on all ALL exported functions and as well as UserFunctions itself. This applies in the header file and in the actual code for the function (i.e. the .h and .cpp files)

Last modified : 31-Jul-2003
Michael Giordano