Hi James,
I have just found why your drawing won’t load. It was an incorrect enum
in PluginAPI.h. The attached header file should fix the problem.
Les
#ifndef PLUGINAPI_H_INCLUDED
#define PLUGINAPI_H_INCLUDED
#define scAPI_VER (1)
enum {scMENU_CHECKED =1, scMENU_ENABLED =2, scMENU_SHOWN =4};
#ifdef SHEETCAM_APP
#define DLLEXPORT __declspec(dllexport)
#else
#ifdef BORLANDC
#define DLLEXPORT __declspec(dllimport)
#else
#define DLLEXPORT
#endif
#endif
extern “C”{
#ifdef SHEETCAM_APP
typedef bool WINAPI (*scInit)(int PluginID, int APIVer);
typedef void WINAPI (*scOnMenu)(int MenuIndex);
typedef void WINAPI (*scOnClose)(void);
#else
#define DLLIMPORT __declspec(dllexport)
/*Functions that SheetCam can call.
Apart from scInit(), all other functions are optional. If they exist
they will be called. If not they will be ignored
/
/ this function must be implemented. It is called immediately after the
dll is loaded. If it returns false then the dll will be ignored.
Use PluginID in all calls to SheetCam where it is needed. If APIVer > scAPI_VER
then you must return false immediately.
*/
DLLIMPORT bool WINAPI scInit(int PluginID, int APIVer);
/* called when a plugin’s menu is accessed*/
DLLIMPORT void WINAPI scOnMenu(int MenuIndex);
/* called when SheetCam closes*/
DLLIMPORT void WINAPI scOnClose(void);
#endif
/* Functions available to the plugin*/
/* Load a drawing into the current part
If FileName == NULL then the user will be prompted for a file and
FileType will be ignored.
returns:
true if file loaded successfully
*/
enum scFILETYPES{scFILETYPE_DXF =1,scFILETYPE_HPGL,scFILETYPE_EXCELLON,
scFILETYPE_EMF};
DLLEXPORT bool WINAPI scLoadDrawing(LPSTR FileName, scFILETYPES FileType);
/* Load a job. If FileName == NULL then the user will be prompted for a file
returns:
true if file loaded successfully
*/
DLLEXPORT bool WINAPI scLoadJob(LPSTR FileName);
/* Check if SheetCam is processing paths. You can still safely call most
functions while SheetCam is processing paths.
returns:
true if SheetCam is processing paths
*/
DLLEXPORT bool WINAPI scIsProcessing(void);
/* Run the currently selected post processor. This function will wait for
SheetCam to finish processing paths before returning.
If OutFile == NULL then the user will be prompted for a file name.
returns:
true if processing complete with no errors
false if file not opened or there were any errors
*/
DLLEXPORT bool WINAPI scRunPost(LPSTR OutFile);
/Menu functions./
/*Add a main menu. It will appear before ‘Before’. For instance if
Before ==“Tools”, the menu will appear between ‘View’ and ‘Tools’.
If Before == NULL or the name does not exist then the menu will appear before
the ‘Help’ menu. If ‘Name’ already exists then no new menu will be created and
the index of the existing menu will be returned. Note Name is not case sensitive
and should not include the & underline symbol.
Returns: -1 to indicate an error or a unique MenuID that can be used
to refer to the menu.
*/
DLLEXPORT int WINAPI scAddMainMenu(int PluginID, LPSTR Before, LPSTR Name);
/*Get the MenuID of an existing menu. Path is a fully qualified path to the menu.
For instance “/Options/Complexity” refers to the Options->Complexity menu.
Note the unix style forward slash!
The names always apply to the English translation even if the menus are
displayed in a different language. They are NOT case sensitive and the & symbol
is ignored.
For example “View” or “vieW” refer to the View menu even if it is displayed
as ‘Anzeige’(German translation).
Returns: -1 if the menu does not exist or a unique Id for that menu
*/
DLLEXPORT int WINAPI scGetMenuID(LPSTR Name);
/*Add a sub menu to a menu. Use the & symbol to underline a letter.
For instance &File would underline the F.
Returns: -1 to indicate an error or a unique MenuID
*/
DLLEXPORT int WINAPI scAddMenu(int PluginID, int MenuID, LPSTR Name);
/* Trigger a menu as it it has been clicked.
Returns: true if the menu was found
/
DLLEXPORT bool WINAPI scDoMenu(int MenuID);
/ Show/hide a menu.
If State == true the menu is shown otherwise it is hidden.
Returns: true if the menu was found
*/
DLLEXPORT bool WINAPI scShowMenu(int MenuID, bool State);
/* Enable a menu.
If State == true the menu is enabled otherwise it is disabled(grayed).
Returns: true if the menu was found
*/
DLLEXPORT bool WINAPI scEnableMenu(int MenuID, bool State);
/* Add/remove a check mark on this menu.
If State == true the menu is checked otherwise it is unchecked.
Returns: true if the menu was found
*/
DLLEXPORT bool WINAPI scCheckMenu(int MenuID, bool State);
/* Get menu state.
Returns: -1 if the menu was found otherwise a bitwise combination of:
scMENU_CHECKED | scMENU_ENABLED | scMENU_SHOWN
/
DLLEXPORT int WINAPI scGetMenuState(int MenuID);
/ Minimize SheetCam window.
Returns: nothing
*/
DLLEXPORT void WINAPI scMinimize(void);
/* Restore SheetCam window and activate
Returns: nothing
*/
DLLEXPORT void WINAPI scShow(void);
}; //extern"C"
#endif