Creating a new plugin project in Visual Studio
For the newbies among our fellow readers, here is a complete step by step walkthrough for creating a new plugin project in Microsoft Visual Studio. The screenshots show Visual Studio 2005, but it still works exactly the same way in Visual Studio 2010.
Basic project setup
You start with just the standard folder structure, containing a “res” folder with your symbols, icons, and string tables, and a “source” folder, containing your C++ Sources (subfolders are – of course – possible).
Additional include paths
If there are any additional include directories where you have stored header files, you must add them to the project’s header search paths. Open the project settings by right-clicking on the project on top of your tree and choosing “Properties”.
Navigate to “Configuration Properties” -> “C/C++” -> “General”. Also make sure that, on top of the dialog, your have selected “All Configurations” and “All Platforms”. This will apply your changes to all build configurations for all platforms, and save you the work for applying a change to each combination separately.
Select the “Additional Include Directories” and click the little “…” icon on the right side. A dialog will pop up. You can add any path here, absolute ones as well as paths relative to your project location.
The Save dialog will come up, asking you to save the solution. By default, the suggested location will be the one of your project file, and the filename will also be the one of your project file. There is no reason to change that.
Setting up a debug session
Even if your project compiles fine, there might still be bugs which you’ll have to address. To do that, you will want to start a debug session with CINEMA 4D.
To set up your project for a debug session, open the project properties again and locate the entry “Debugging” in the tree on the left side. On the right side, in the “Command” entry, click the little “…” icon and select the CINEMA 4D.exe.
Note: As long as you don’t experience any issues that only occur in a 64 Bit build, you will want to use the 32 Bit build for debugging. That is, because Visual Studio only supports the “Edit and Continue” (pausing the execution, changing your code, and then continuing execution) functionality for 32 Bit. With a 64 Bit build, you will always have to stop execution, then build your project again, and then restart CINEMA 4D.