plugin DLL project for MS Visual C++ 6

Request and discuss new features
Post Reply
jemmyell

plugin DLL project for MS Visual C++ 6

Post by jemmyell »

Hi Les,

Thanks so much for the new plugin SDK. Many developers (such as myself) still use VC++ 6 so here is a set of test project files for your baseline plugin 'demo'.

Thanks again,

-James
User avatar
Les Newell
Site Admin
Posts: 3665
Joined: Thu May 11, 2006 8:12 pm

plugin DLL project for MS Visual C++ 6

Post by Les Newell »

Thanks James,

How did you generate the .lib file? Also does this project put the dll
in the SheetCam folder?

Thanks,
Les

jemmyell wrote:
Hi Les,

Thanks so much for the new plugin SDK. Many developers (such as myself) still use VC++ 6 so here is a set of test project files for your baseline plugin 'demo'.
jemmyell

Post by jemmyell »

Hi Les,

I used the sheetcam.lib that shipped with the SDK, there were no issues. I did not do a post-build copy into the sheetcam folder, I just built a release DLL and copied it there. I just wanted to get this back out here to support the effort.

Thanks again, I will let you know how the VB interface plugin goes.

-James
jemmyell

New demo plugin for VC++ 6 with debug message API added

Post by jemmyell »

Hi Les,

Here is a version of the demo plugin, 'DbgDemo'. It adds two files 'dbg.h' and 'dbg.cpp'. These are a very small set of functions and macros that give a very flexible interface to OutputDebugString. In addition, the debug build only macros compile out completely, removing ALL overhead from adding these messages to the plugin. Here is what the 'dbg.h' header looks like:

// dbg.h

// Debug message API for DLL development. The macros 'DbgMsg' and 'ApiDbgMsg'
// will only compile to code in a DEBUG build of a DLL project. In a RELEASE
// build they will compile totally out, leaving no overhead at all in the
// finished RELEASE / RETAIL product that incorporates the DLL.

// These macros allow full 'printf' syntax variable argument lists so that
// any parameters or local values may be output by the debug message system
// easily. I.E. to display a WORD value 'wordValue' you would code:
// DbgMsg("The value of wordValue = %u", wordValue);

// Since this library uses OutputDebugString as the actual method to output
// the debug messages, any utility that can display these messages will catch
// them and display them. If you are debugging in Visual Studio, the debugger
// will do this. BUT, my hands down favorite for a a debug message console
// is DebugView from the SysInternals website. You may download this FREE
// from: http://www.sysinternals.com/

#ifndef DBG_API_H_INCLUDED

#define DBG_API_H_INCLUDED

#include "stdio.h"
#include "stdarg.h"
#include "comdef.h"

#ifdef _DEBUG
#define RelMsg DebugMessage
#define DbgMsg DebugMessage
#define ApiDbgMsg ApiDebugMessage
#define PushDbgMode __savDbgMode = __dbgMode;
#define PopDbgMode __dbgMode = __savDbgMode;
#define DbgOn __dbgMode = true;
#define DbgOff __dbgMode = false;
#else
#define RelMsg DebugMessage
#define DbgMsg
#define ApiDbgMsg
#define PushDbgMode
#define PopDbgMode
#define DbgOn
#define DbgOff
#endif

// DbgMsg system

void _stdcall ApiDebugMessage(char *msg);
void _stdcall DebugMessage(char *msg, ...);
void _stdcall DbgMode(bool mode);
void com_error_msg(_com_error &e);

extern BOOL __dbgMode;
extern BOOL __savDbgMode;

#endif

In addition, both the debug and release projects copy the resulting DLL into c:\program files\sheetcam for testing.

REQUEST: Could you add a 'scExit' function that is called by SheetCam at shutdown time? I will be writing a plugin that has a COM object, so there will be issues of independent instantiation. I.E. I may be running before or after SheetCam and I need to manage this. Setting a simple global flag will do, but I need the 'scExit' function call to cleanly manage the 'SheetCam not running' state. Also would it be possible to add a command line switch that would hide the SheetCam UI? This would make it able to pretty much be a true component. It would also be nice to be able hide / show the UI at run time. That way, it won't take focus away from me when it paints toolpaths, and I can let my users see and interact with SheetCam at their discretion.

-James
User avatar
Les Newell
Site Admin
Posts: 3665
Joined: Thu May 11, 2006 8:12 pm

plugin DLL project for MS Visual C++ 6

Post by Les Newell »

Hi James,

Thanks for the files. Yes I will add an scExit() function. I am not
convinced it is a good idea to make SheetCam completely hidden. The user
should definitely check the toolpaths before post processing. SheetCam
won't grab the focus once it has started. I can add something like
scMimimize() and scShow() or something like that.

What other functions do you think should be added? I will hopefully be
adding import filter and post processor functions in the nearish future
but I am not sure exactly when.

Les
jemmyell

Post by jemmyell »

Hi Les,

Yes, minimize and show will be fine. I think I have what I need to build my prototype now, I just need to be careful of managing the state manually until I get scExit. I will let you know what comes up as I work my way through the first implementation. This is very exciting and I see almost endless possibilities here.

-James
Post Reply