Create an external module in VC++5.0

By Rob Salgado and Tav Hawkins (2 Oct 98)
Based on Yuh-Jye Chang's instructions (18 Mar 98).

  • Have Microsoft Visual C++ 5.0 installed.

  • Download the Win95/NT External Module Developer Kit.

  • Create a directory, extract everything (files and folders) into that directory. (We'll assume that n:\develop is the folder which contains external.dsw and the folders awt, filter, neat, etc...) There are three example projects, JMindSetObj, JVitalSignObj, and JGestureObj. The header files are in awt, io, lang, modules, neat, neat, and util. Some reference source code are in neat and modules directory.

  1. In the n:\develop folder, Create a new folder, called JSimpleExternalObj.
    Place your source and header files, e.g., JSimpleExternalObj.cpp and JSimpleExternalObj.h, in this folder.

  2. external dswOpen external.dsw in Microsoft Developer Studio.

  3. Select toolbar-menu item [File] -> [New...].
    In the [New] dialog box, Click on the [Projects] tab.

    new projects

    Select [Win32 Dynamic-Link Library].
    Type in for Project name: "JSimpleExternalObj" Change the Location: to "n:\develop\JSimpleExternalObj".
    Check the entire Location path before continuing.
    Select [Add to current workspace], Press [OK].

  4. Select toolbar-menu item [Build] -> [Configurations...]
    In the [Configurations] dialog box,

    build configurations

    Under the JSimpleExternalObj project, Click on [Projects] tab.
    Select [Win32 Debug].
    Press [Remove] to remove it.
    Press [Close].

  5. Select toolbar-menu item [Project] -> [Settings...]
    In the [Project Settings] dialog box,
    In the [Settings For:] tree-view, Select JSimpleExternalObj.

    project settings
  6. Select the [C/C++] tab.
    In the [Category:] pull-down menu, Select [General].
    In the [Preprocessor Definitions:] text-line, Add ",_EXTERNAL_DLL" to the end of the line.

    c++ settings


  7. In the [Category:] pull-down menu, Select [Code Generation].
    In the [Use run-time library:] pull-down menu, Select [Multithreaded].

    c++ code generation


  8. In the [Category:] pull-down menu, Select [Preprocessor].
    In the [Additional include directories:] text-line, Add "..\lang,..\util,..\io,..\net,..\awt,..\neat".


    (This specifies that, from within the JSimpleExternalObj folder, we wish to include code from the sister folders lang, util, io, net, awt, neat, which are accessible as ..\lang, ..\util, ..\io, ..\net, ..\awt,and ..\neat.)

  9. Select the [Link] tab.


    In the [Output file name:] text-line, Modify the entry to read "../JSimpleExternalObj.dll" (so it will be created in the n:\develop folder).
    In the [Object/library modules:] text-line, Add the libraries that you use (Yuh-Jye suggests that, usually, user32.lib is enough.).
    Press [OK].

  10. In the [Workspace] window, Select the [File View] tab.
    Right-click on [JSimpleExternalObj files].
    In the popup menu, select [Set as Active Project].

    active project


  11. Right click on [JSimpleExternalObj files] again.
    In the popup menu, select [Add Files into Project...].
    In the [Add Files into Project...] dialog box,

    add files


  12. We will next Add awt.lib, base.lib, neat.lib:

    • using method 1:
      Assuming that we are viewing the n:\develop folder, Type exactly on [File name:] (including double-quotes and spaces) "neat.lib" "base.lib" "awt.lib"
      Click [Ok].
    • using method 2:
      Assuming that we are viewing the n:\develop folder,
      In the [Files of type:] pull-down menu,
      Select [Library Files (.lib)] or [All Files (*.*)] in order to view awt.lib, base.lib, neat.lib.
      Select awt.lib, base.lib, neat.lib.
      Click [Ok].

    ADD any other required .lib files.
    ADD your NeatTools Module .cpp and .h source and header files.

    added files
  13. You may wish to organize your files into folders.

    new folder

    Right click on [JSimpleExternalObj files] again.
    In the popup menu, select [New Folder...].

    new folder

    In the [Name of the new folder] text-line, type "Library Files".
    In the [File extensions] text-line, type "lib". And so forth...
    Drag files into the appropriate folder. (Subsequent files added to the project will be automatically placed in the appropriate folders.)

  14. Now we're ready to build the module.
    Right click on [JSimpleExternalObj files].

    build selection only

    In the popup menu, Select [Build (selection only)] to build your JSimpleExternalObj.dll in the n:\develop folder. (You may wish to move your .dll files in the NeatTools directory.)

  15. Now we're ready to run NeatTools with our external module.
    Run NeatTools.

    neat tools

    Load your external module with the [LM] button.