|
马上注册登录,享用更多网站功能!
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
在VC中编写好如后函数,并且运行没有错误后,在PROE中注册失败,请各位大侠看看。
#include "stdafx.h"
#include "pdxcad.h"
#include "framestart1.h"
#include "ProMenu.h"
#include "ProUtil.h"
#include "ProMenubar.h"
#include "ProWindows.h"
#include "ProMessage.h"
#include "ProToolkit.h"
#include "ProUtil.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
更多设计
#
|
|