Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   Related Pages  

Creating a New Plugin Project

Overview

This section explains the procedures which are common to all new plugin projects. It is assumed that the developer uses Microsoft Visual C++.

New Project File

To create a new Demopaja plugin project file follow the steps below:

  1. Choose File > New... then make sure the Projects tab is active.
  2. Select Win32 Dynamic Link Library from the list.
  3. Select the directory where the plugin project is created and fill in the project name.
  4. Press OK button to exit the dialog.
  5. At the prompt What kind of DLL would you like to create? choose An Empty DLL project.

Setting the Project Settings

First you will need to specify the output file name for the plugin. It is convenient to set the output directory to the directory where the other Demopaja plugins are. This way you don't have to copy the plugin file all the time. It's assumed that the Demopaja application is installed in directory C:\demopaja. You specify the output file name as follows:

  1. Choose Project > Settings... (ALT + F7). Make sure all the settings arebeing changed by selecting All Configurations from the Settings For: dropdown list. The next procedures assumes that all configurations are select until otherwise told.
  2. Select the Link tab.
  3. On the Output file name: editbox enter the path for the Demopaja plugin directory plus the name of you plugin. For example: C:\demopaja\plugins\myplugin.dll.
Since DLL cannot be run themselfs we need to specify an executable which will be run. Of course we will use the Demopaja application. To select the application:

  1. Select the Debug tab from the Project Settings dialog.
  2. Press the arrow next to the Executable for the debug session editbox and Choose Browse....
  3. Browse to the Demopaja directory and select the Demopaja executable. Press OK. Now the editbox should read for example: C:\demopaja\demopaja.exe.
  4. In the working directory write the Demopaja path. For example: C:\demopaja.
The third change to the project settings is to specify the path where the Demopaja SDK header files can be found. If you have the Demopaja SDK installed on C:\demopajasdk use the following:

  1. Select the C/C++ tab from the Project Settings dialog.
  2. Select Preprocessor rom the Category: dropdown list.
  3. On the Additional include directories: editbox enter the path C:\demopajasdk\include.
The next step is to specify the libraries you need to use. You should still keep the All Configurations selected. Pay attention to the library names. The debug library ends to D character and release to R.

  1. Select the Link tab from the Project Settings dialog.
  2. Choose the Input from the Category: dropdown list.
  3. On the Additional library path: editbox write the path C:\demopajasdk\lib.
Now update the Win32 Debug settings:

  1. From the Settings For: dropdown list choose Win32 Debug.
  2. From the Link tab, under the Category: dropdown list select General.
  3. Add corelibd.lib to the Object/library modules: edit box.
  4. From the C/C++ tab, under the Category: dropdown list select Code generation.
  5. Make sure Debug Multithreaded is selected from the Use run-time library: dropdown list.
Now update the Win32 Release settings:

  1. From the Settings For: dropdown list choose Win32 Release.
  2. From the Link tab, under the Category: dropdown list select General.
  3. Add corelibr.lib to the Object/library modules: edit box.
  4. From the C/C++ tab, under the Category: dropdown list select Code generation.
  5. Make sure Multithreaded is selected from the Use run-time library: dropdown list.
Now all the settings for the project are set. It is good idea to save the workspace now.

Adding CPP file to the project

To create a new plugin class you will need a C++ source file where the code for the plugin is written. To create a new C++ source file follow the steps below:

  1. Choose File > New... then make sure the Files tab is activate.
  2. Select C++ Source File from the list.
  3. Fill in the name for the file and press OK to exit the dialog.
In addition to the CPP source file you propably will need a C++ header file too. The steps to create a new header file is similar, just choose C/C++ Header File from the Files list.

See also:
Creating the DLL functions

Moppi Demopaja SDK Documentation -- Copyright © 2000-2002 Moppi Productions