Getting Started with CorelDRAW C++ plugin and DLL projects (for X3 and X4)
The plugin and DLL code is loosely based on posts by Alex Vakulenko at the OberonPlace forums. A forum search there should always be the 'first stop' when you are looking for 'howto' information.
These projects were made with the FREE Microsoft Visual C++ Express Edition 2008. It can be downloaded from:
http://www.microsoft.com/Express/VC/
There are 'getting started' links there also. To get the most from this compiler you also need to download and install the Visual Studio 2008 SDK 1.1 from:
http://www.microsoft.com/downloads/deta ... oContainer
The Express Edition does NOT include a dialog editor so I use ResEdit to edit the standard windows dialogs thast I use in my VC++ 2008 Express projects. You can download FREE ResEdit from:
http://www.resedit.net/
I use the UNICODE build for these projects.
The debug message system for these projects uses Microsft (Sysinternals) DebugView to catch and display the debug messages. You can download DebugView from:
http://technet.microsoft.com/en-us/sysi ... 96647.aspx
These projects can be built for either CorelDRAW X3 or X4. The way this is changed is in CorelDRAW.h for the dll and in UniPluginFunctions.cpp for the plugin. Here is what you are looking for:
// Uncomment EITHER CDR_V13 or CDR_V14 to compile for X3 or X4
//#define CDR_V13
#define CDR_V14
To get started, download and install ALL of the software mentioned above. Read as much of the instructions as necessary to get this done. Then just copy the projects into folders on your computer. For example:
C:\CorelDRAWDev\VC++2008_Express\UniCdrPluginBase
C:\CorelDRAWDev\VC++2008_Express\UniCdrBaseDll
Start the Visual C++ 2008 Express and you will see a 'file' menu in the upper left. Use the file menu to open a project / soluiton. For the plugin you will browse to C:\CorelDRAWDev\VC++2008_Express\UniCdrPluginBase and open UniCdrPluginBase.sln.
You can then build the solution by selecting the 'build' menu and using the 'rebuild all' menu selection.
NOTE: If you do not have a CorelDRAW version installed on your system your builds will fail. I.E. If you select an X3 build and you do NOT have X3 installed your build will fail for a number of reasons.
The plugin dll build will be renamed to cpg and copied to the \Draw\Plugins folderfor the CorelDRAW version you built for IF it is installed on the C: drive in the standard location. You will have to edit the .BAT files that do this if you have a custom installation.
To learn the API for C++ programming, just read the generated .tli and .tlh files from the builds. They will be in the Debug or Release folders depending on the type of build you are doing. The VBA documentation can give broad method and property usage guidelines. Just translate from VBA to C++ SmartPointer syntax. For example the VBA Class 'Application' is an IDrawApplicationPtr, a VBA 'Shape' class is an IDrawShapePtr
