1、添加【libcustomDEMO_methods.h】头文件
头文件内容
#include <ict_userservice.h>
#include <iman.h>
#include <custom.h>
#include <epm_toolkit_tc_utils.h>
#ifdef __cplusplus
extern "C" {
#endif
extern DLLAPI int libcustomDEMO_register_handler(int *decision, va_list args);
extern DLLAPI int DEMO_get_workflow_parameter(EPM_action_message_t msg);
#ifdef __cplusplus
}
#endif
2、添加【libcustomDEMO_register_callbacks.cpp】源文件
源文件内容
#include "libcustomDEMO_methods.h"
#ifdef __cplusplus
extern "C" {
#endif
DLLAPI int libcustomDEMO_register_callbacks()
{
int ifail = ITK_ok;
printf("******************************************************\n");
printf("* libcustomDEMO_register_callbacks *\n");
printf("******************************************************\n");
CUSTOM_register_exit("libcustomDEMO", "USER_gs_shell_init_module",
(CUSTOM_EXIT_ftn_t)libcustomDEMO_register_handler);
return ifail;
}
#ifdef __cplusplus
}
#endif
3、添加【libcustomDEMO_methods.cpp】源文件,内容如下
#include "libcustomDEMO_methods.h"
extern DLLAPI int libcustomDEMO_register_handler(int *decision, va_list args)
{
int ifail = ITK_ok;
//action handler
EPM_register_action_handler("DEMO_get_workflow_parameter", "获取工作流程参数",
(EPM_action_handler_t)DEMO_get_workflow_parameter);
*decision = ALL_CUSTOMIZATIONS;
return ifail;
}
4、添加【DEMO_get_workflow_parameter.cpp】源文件,内容如下
#include "libcustomDEMO_methods.h"
int DEMO_get_workflow_parameter(EPM_action_message_t msg)
{
int ifail = ITK_ok;
printf("执行获取工作流程参数");
return ifail;
}
5、右键项目【重新生成】,找到生成的【dll】文件
6、【dll】文件放入【bin】目录下
7、将【dll】添加到【TC_customization_libraries】首选项中
8、重新登录【TC】,查看【TAO】窗口信息
9、新建流程,添加【action handler】,流程执行开始打印【执行获取工作流程参数】