再此TOOLKIT程序和VC的交互无需使用动态库调用(编写两个动态库)
编写入口及菜单添加函数:
/*====================================================================*\
FUNCTION : user_initialize()
PURPOSE : Pro/TOOLKIT程序的总入口,完成初始化工作
\*====================================================================*/
extern "C" int user_initialize(
int argc,
char *argv[],
char *version,
char *build,
wchar_t errbuf[80])
{
 roError status;
uiCmdCmdId cmd_id;
 roFileName mf;
 roStringToWstring(mf,"usermsg.txt");
status = ProMenubarMenuAdd ("Menu0", "USER Menu0",
"Help", PRO_B_TRUE, mf);
// 0添加父菜单Menu0
status = ProMenubarmenuMenuAdd ("Menu0", "Menu1", "USER Menu1",
NULL, PRO_B_TRUE, mf);
添加弹出式菜单Menu1
status = ProCmdActionAdd("Menu2", (uiCmdCmdActFn)TestAccessDefault,
uiCmdPrioDefault, TestAccessDefault, PRO_B_TRUE, PRO_B_TRUE, [$cmd_id)]
-1菜单Menu2动作
status = ProMenubarmenuPushbuttonAdd ("Menu1", "Menu2",
"USER Menu2", "USER Menu2 help", NULL, PRO_B_TRUE,cmd_id, mf);
-1添加菜单Menu2
return 0;
} |