列兵
UID2466229
U币0
G币0
技术0
主题4
精华0
阅读权限10
注册时间2011-5-30
最后登录1970-1-1
在线时间0 小时
列兵
|
// sheji.cpp : 定义 DLL 的初始化例程。
//
#include "stdafx.h"
#include "sheji.h"
#include "ProToolkit.h"
#include "ProMenu.h"
#include "ProMenubar.h"
#include "ProMessage.h"
#include "ProUtil.h"
#include "ProUICmd.h"
#include <ProWindows.h>
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[]=_FILE[]
#endif
extern "C" int user_initialize()
{
ProError status;
ProFileName MsgFile;
uiCmdCmdId PushButton_cmd_id1,PushButton_cmd_id2,
PushButton_cmd_id3,PushButton_cmd_id4;
ProStringToWstring(MsgFile, "Message.txt");//设置菜单信息文件名
/*=========================================================*\
添加菜单条
\*=========================================================*/
status=ProMenubarMenuAdd ("UserMenuBar", "UserMenu",
"Utilities", PRO_B_TRUE, MsgFile);
/*=======================================================*\
菜单条的下级子菜单设置
\*=========================================================*/
//添加下级子菜单项
ProMenubarmenuMenuAdd("UserMenuBar", "SubMenu", "SubMenu",
NULL, PRO_B_TRUE, MsgFile);
//设置菜单按钮的动作函数
ProCmdActionAdd("PushButtonAct1",(uiCmdCmdActFn)Duangai1Fn,
uiCmdPrioDefault,AccessAvailable,
PRO_B_TRUE,PRO_B_TRUE,&PushButton_cmd_id1);
//添加菜单按钮
ProMenubarmenuPushbuttonAdd("SubMenu", "PushButton1", "PushButton1",
"Adding a push button to the ProE menu bar", NULL,
PRO_B_TRUE, PushButton_cmd_id1, MsgFile);
//设置菜单按钮的动作函数
ProCmdActionAdd("PushButtonAct2",(uiCmdCmdActFn)Duangai2Fn,
uiCmdPrioDefault,AccessAvailable,
PRO_B_TRUE,PRO_B_TRUE,&PushButton_cmd_id2);
//添加菜单按钮
ProMenubarmenuPushbuttonAdd("SubMenu","PushButton2","PushButton2",
"Adding another push button to the ProE menu bar",NULL,
PRO_B_TRUE, PushButton_cmd_id2, MsgFile);
//设置菜单按钮的动作函数
ProCmdActionAdd("PushButtonAct3",(uiCmdCmdActFn)Duangai3Fn,
uiCmdPrioDefault,AccessAvailable,
PRO_B_TRUE,PRO_B_TRUE,&PushButton_cmd_id3);
//添加菜单按钮
ProMenubarmenuPushbuttonAdd("SubMenu","PushButton3","PushButton3",
"Adding the third push button to the ProE menu bar",NULL,
PRO_B_TRUE, PushButton_cmd_id3, MsgFile);
//设置菜单按钮的动作函数
ProCmdActionAdd("PushButtonAct4",(uiCmdCmdActFn)Duangai4Fn,
uiCmdPrioDefault,AccessAvailable,
PRO_B_TRUE,PRO_B_TRUE,&PushButton_cmd_id4);
//添加菜单按钮
ProMenubarmenuPushbuttonAdd("SubMenu","PushButton4", "PushButton4",
"Adding the forth push button to the ProE menu bar", NULL,
PRO_B_TRUE, PushButton_cmd_id4, MsgFile);
return status;
}
/*=========================================================*\
FUNCTION: user_terminate()
\*=========================================================*/
extern "C" void user_terminate()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
}
/*=========================================================*\
FUNCTION: AccessAvailable (菜单项的访问权限设置:可选)
\*=========================================================*/
static uiCmdAccessState AccessAvailable (uiCmdAccessMode access_mode)
{
return (ACCESS_AVAILABLE);
}
错误
1>f:\自制视频\sheji\sheji\sheji.cpp(17) : error C2065: '_FILE' : undeclared identifier
1>f:\自制视频\sheji\sheji\sheji.cpp(17) : error C2059: syntax error : ']'
1>f:\自制视频\sheji\sheji\sheji.cpp(20) : error C2143: syntax error : missing ';' before '{'
1>f:\自制视频\sheji\sheji\sheji.cpp(20) : error C2447: '{' : missing function header (old-style formal list?)
1>生成日志保存在“file://f:\自制视频\sheji\sheji\Debug\BuildLog.htm”
1>sheji - 5 个错误,1 个警告
========== 生成: 0 已成功, 1 已失败, 0 最新, 0 已跳过 ========== |
|