I am trying to Implementing Module DLLs (SDK-Documentation-ModuleDevelopment).
But there is always throw a error when I try to build my module dll (testmodel.dll in the Documentation) :
Error 1 error C2509: 'beginOffset' : member function not declared in 'MyTaskExecuter' \testmodule\mytaskexecuter.cpp 9 1 testmodule
And the source code:
_______________________
MyTaskExecuter.cpp
#include "MyTaskExecuter.h" void MyTaskExecuter::bindVariables() { TaskExecuter::bindVariables(); } double MyTaskExecuter::beginOffset(double endspeed, treenode item) { offsetloc[1] = 0; offsetloc[2] = 0; return beginOffsetDefault(endspeed, item); }
_____________________________
MyTaskExecuter.h
#pragma once #include "FlexsimDefs.h" class MyTaskExecuter : public TaskExecuter { virtual void bindVariables() override; };
_____________________
testmodule.cpp
#include "testmodule.h" visible ObjectDataType* createodtderivative(char* classname) { if (strcmp(classname, "MyTaskExecuter") == 0) return new MyTaskExecuter; return NULL; } visible SimpleDataType* createsdtderivative(char* classname) { return NULL; } visible void dllinitialize() { } visible void dllcleanup() { }
testmodule.h
#pragma once #include "FlexsimDefs.h" #include "allobjects.h" class MyTaskExecuter : public TaskExecuter { public: virtual void bindVariables(void); virtual double beginOffset(double endspeed, treenode item); };