Hi,
I am trying to collect some of my functions and classes (which I tend to reuse) and put them in a single DLL which I can then use in my plug-ins. So far I have not been completely successful. I would appreciate some help with this. You can find a very simple VS2010 C++ example here (which is based on the Moose example) and bellow I pointed out what I did and what doesn`t work:
testcallpalib.zip (1.8 MB)
(Here is it again if the attachment didnt work
https://drive.google.com/file/d/0B-30e0YjksYfdHFrTXJiZnpGS2s/view?usp=sharing )
-
The Preprocessor definition PA_DLL_EXPORTS is defined in the pa_lib project properties
-
pa_lib_LinkingPragmas.h is done based on the Mosse example
-
I put all definitions (PA_CPP_FUNCTION etc…) at the end of the stdafx.h in the pa_lib project (so they can be accessible from everywhere)
-
In the testcallpalib project, in the stdafx.h I included:
#include “…/pa_lib/pa_functions.h”
#include “…/pa_lib/pa_myclass.h” -
Finally in the cmdtestcallpalib I do something like this:
ON_3dPoint pt = PA_SelectPoint(L"select a point");
CPA_MyClass myclass;
After this setup - everything compiles fine. However, if I try to load the plug-in I get the following message: Plug-in commands must pass a pointer to their parent plug-in…(image bellow)
If I simply comment out the call to the PA_SelectPoint function in the cmdtestcallpalib, the plug-in will load normally…but that doesnt help much.
So my questions are:
- Why is that message there? How can I avoid it and get the functions to work.
- Is the rest of the setup ok? Especially for the class? I would really like for this to work for functions and classes…
(3. the next step would be to somehow only link the DLL if it is possible, and not insert the entire pa_lib project in the solution, but one step at the time…)
Solution for this would mean very much to me…thanks a lot!