Sample Source Code (How to Create a Plug-In)

www.CAD6.com

The CAD6interface package comes with complete, compile-ready source code of three different sample plug-ins:

 

Sample Plug-In "Sample" (Directory "sample")

Implementation of a small plug-in with language-dependent resource DLLs for multiple language development. It adds two commands to the application: One for drawing a star immediately, and one for creating a star as an editable extended object.

It consists of:

- Main plug-in sample_.dll in the base directory,

- Icon file sample.png in the base directory,

- Language DLL sample.dll for English and German in the ".\e" and ".\d" sub-directories,

- Help file sample.chm in the ".\help\e" and ".\help\d" sub-directories.

To use the plug-in, you have to copy these four files into your CAD6 directory. See also External Commands and Creating Extended Objects.

 

Sample Plug-In "Export" (Directory "export")

Implementation of a simple coordinate export filter with language-dependent resource DLLs for multiple language development.

It consists of:

- Main plug-in export_.dll in the base directory,

- Icon file export.png in the base directory,

- Language DLL export.dll for English and German in the ".\e" and ".\d" sub-directories,

- Help file export.chm in the ".\help\e" and ".\help\d" sub-directories.

To use the filter, you have to copy these four files into your CAD6 directory. See also Export Filters.

 

Sample Plug-In "Import" (Directory "import")

Implementation of a simple coordinate import filter with language-dependent resource DLLs for multiple language development.

It consists of:

- Main plug-in import_.dll in the base directory,

- Icon file import.png in the base directory,

- Language DLL import.dll for English and German in the ".\e" and ".\d" sub-directories,

- Help file import.chm in the ".\help\e" and ".\help\d" sub-directories.

To use the filter, you have to copy these four files into your CAD6 directory. See also Import Filters.

 

All source code of those sample plug-ins is made for Visual Studio 2019 according to ISO C++14 Standard and Microsoft Visual Studio legacy C option (mainly to allow "empty" arrays at the end of structures and classes).

 

The project files for the sample plug-ins reference a Microsoft Visual Studio ruleset for code analysis which is located in the file MKCAD6.RULESET which is part of the package and should be placed in your CAD6 directory. If you are using Microsoft's Visual Studio 2019, we recommend that you check your plug-ins against this ruleset and try to minimize the number of warnings generated. This will significantly better your code!

 

If you are using Microsoft's Visual Studio, you can use the file USERTYPE.DAT that comes together with MKI_LIB6.H and MKI_LIB6.LIB. Copy that file into the \BIN directory of your compiler's directory and from the next compiler start on, all types and definitions related to CAD6interface will be highlighted in the source editor.

 

CAD6interface 2024.2 - Copyright 2024 Malz++Kassner® GmbH