Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagecpp
titleCalling a module from code
void CMyClass::MyModuleCallback(bool bSuccess, const TModuleParams& outputParams) 
{
   // do something with the output parameters 
}

void CMyClass::CallMyModule()
{
   IFlowGraphModuleManager* pModuleManager = gEnv->pFlowSystem->GetIModuleManager();
   if (const IFlowGraphModule* pModule = pModuleManager->GetModule(“MyModule”))
   {
      TModuleParams inputParams;
      //… add input parameters (has to match the inputs in the modulesmodule)
      pModuleManager->CreateModuleInstance(pModule->GetId(), inputParams, functor(*this, &CMyClass::MyModuleCallback));
   }
}

...