iCAx开思网
标题:
proe二次开发菜单添加遇到的问题 像各位大侠求助
[打印本页]
作者:
jbieber1989
时间:
2012-6-23 14:27
标题:
proe二次开发菜单添加遇到的问题 像各位大侠求助
在VC中写好入口函数,在VC中运行没有错误,并编辑好了菜单信息文件,在proe中注册失败,下面是我编写的如口函数,请指教。
#include "stdafx.h"
#include "pdxcad.h"
#include "framestart1.h"
void moreMenuActFn();
void bendingpdxcadMenuActFn();
static uiCmdAccessState AccessAvailable (uiCmdAccessMode);
CPdxcadApp theApp;
framestart1 *pdlg1=NULL;
extern "C" int user_initialize()
{
ProError status;
ProFileName MsgFile;
uiCmdCmdId cmd_id1,cmd_id2;
ProStringToWstring(MsgFile,"Message.txt");//设置菜单信息文件名
//添加菜单条
status=ProMenubarMenuAdd("pdxcad","级进模CAD系统",
"Utilities",PRO_B_TRUE,MsgFile);
//添加菜单按钮
ProCmdActionAdd("PushButtonAct1",(uiCmdCmdActFn)bendingpdxcadMenuActFn,uiCmdPrioDefault,AccessAvailable,
PRO_B_TRUE,PRO_B_TRUE,&cmd_id1);
ProMenubarmenuPushbuttonAdd("pdxcad","bendingpdxcad","弯曲级进模CAD系统",
"弯曲级进模CAD系统设计",NULL,PRO_B_TRUE,cmd_id1,MsgFile);
ProCmdActionAdd("PushButtonAct2",(uiCmdCmdActFn)moreMenuActFn,uiCmdPrioDefault,AccessAvailable,
PRO_B_TRUE,PRO_B_TRUE,&cmd_id2);
ProMenubarmenuPushbuttonAdd("pdxcad","more","更多",
"更多设计",NULL,PRO_B_TRUE,cmd_id2,MsgFile);
return status;
}
extern "C" void user_terminate()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
}
/*================================================================*\
FUNCTION: AccessAvailable (菜单项的访问权限设置:可选)
\*================================================================*/
static uiCmdAccessState AccessAvailable (uiCmdAccessMode access_mode)
{
return (ACCESS_AVAILABLE);
}
void bendingpdxcadMenuActFn()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
if (pdlg1==NULL)
{
pdlg1=new framestart1();
pdlg1->Create(IDD_pdxcaddlg);
pdlg1->ShowWindow(SW_SHOW);
}
else
{
pdlg1->ShowWindow(SW_SHOW);
}
//UsrActivateCurrentWindow();
}
void moreMenuActFn()
{
AfxMessageBox("等待有能力者开发!",MB_OK);
}
信息文件:
级进模设计
pdxcad
级进模设计
#
弯曲级进模CAD系统
bendingpdxcad
弯曲级进模CAD系统
#
弯曲级进模具CAD系统设计
bendingpdxcad
弯曲级进模具CAD系统设计
#
更多
more
更多
#
更多设计
more
更多设计
#
欢迎光临 iCAx开思网 (https://www.icax.org/)
Powered by Discuz! X3.3