找回密码 注册 QQ登录
一站式解决方案

iCAx开思网

CAD/CAM/CAE/设计/模具 高清视频【积分说明】如何快速获得积分?快速3D打印 手板模型CNC加工服务在线3D打印服务,上传模型,自动报价
查看: 17058|回复: 1
打印 上一主题 下一主题

[求助] 一注册PROE就自动退出

[复制链接]
跳转到指定楼层
1
发表于 2009-7-17 10:14:19 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

马上注册,结交更多同行朋友,交流,分享,学习。

您需要 登录 才可以下载或查看,没有帐号?注册

x
我想在菜单栏添加一个一个菜单条,然后在下面添加一个PUSHBUTTON,
不知怎么了,一注册就退出,
代码如下

// proe_MenubarAdd.cpp : Defines the initialization routines for the DLL.
//
#include "stdafx.h"
#include "proe_MenubarAdd.h"
#define PRO_USE_VAR_ARGS 1
/*--------------------------------------------------------------------*\
Pro/TOOLKIT includes
\*--------------------------------------------------------------------*/
#include"ProMenu.h"
#include"ProUtil.h"
#include"ProMenubar.h"
#include <ProMessage.h>
/*--------------------------------------------------------------------*\
Functions declaration  函数声明
\*--------------------------------------------------------------------*/
int ShowMessage();
static uiCmdAccessState AccessAvailable (uiCmdAccessMode);
static uiCmdAccessState AccessUnAvailable (uiCmdAccessMode);
static uiCmdAccessState AccessRemove (uiCmdAccessMode);

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//
// Note!
//
//  If this DLL is dynamically linked against the MFC
//  DLLs, any functions exported from this DLL which
//  call into MFC must have the AFX_MANAGE_STATE macro
//  added at the very beginning of the function.
//
//  For example:
//
//  extern "C" BOOL PASCAL EXPORT ExportedFunction()
//  {
//   AFX_MANAGE_STATE(AfxGetStaticModuleState());
//   // normal function body here
//  }
//
//  It is very important that this macro appear in each
//  function, prior to any calls into MFC.  This means that
//  it must appear as the first statement within the
//  function, even before any object variable declarations
//  as their constructors may generate calls into the MFC
//  DLL.
//
//  Please see MFC Technical Notes 33 and 58 for additional
//  details.
//
/////////////////////////////////////////////////////////////////////////////
// CProe_MenubarAddApp
BEGIN_MESSAGE_MAP(CProe_MenubarAddApp, CWinApp)
//{{AFX_MSG_MAP(CProe_MenubarAddApp)
  // NOTE - the ClassWizard will add and remove mapping macros here.
  //    DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CProe_MenubarAddApp construction
CProe_MenubarAddApp::CProe_MenubarAddApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CProe_MenubarAddApp object
CProe_MenubarAddApp theApp;
/*=======================================================================*\
FUNCTION: user_initialize()
\*=======================================================================*/
extern "C" int user_initialize()
{
    ProError status;
ProFileName MsgFile;
    uiCmdCmdId   PushButton_cmd_id;//radio_act,ModeMenu_cmd_id;//修改处1
ProStringToWstring(MsgFile, "Message1.txt");//设置菜单信息文件名.修改处2
/*=========================================================*\
     添加菜单条"练习"
    \*=========================================================*/
status=ProMenubarMenuAdd ("UserMenuBar", "Exercise",
                        "help", PRO_B_TRUE, MsgFile);
/*=========================================================*\
     菜单按钮设置(添加菜单条按钮‘创建模型’)
    \*=========================================================*/
//设置菜单按钮的动作函数
ProCmdActionAdd("PushButtonAct",(uiCmdCmdActFn)ShowMessage,//激活菜单条菜单命令时调用的动作函数
              uiCmdPrioDefault,AccessAvailable,
        PRO_B_TRUE,PRO_B_TRUE,&PushButton_cmd_id);
    //添加菜单按钮
ProMenubarmenuPushbuttonAdd("UserMenuBar", "PushButton", "CreateModel",
             "Adding a push button to the ProE menu bar", NULL,
           PRO_B_TRUE, PushButton_cmd_id, 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);
}
/*================================================================*\
FUNCTION: AccessUnAvailable()(菜单项的访问权限设置:不可选)
\*================================================================*/
static uiCmdAccessState AccessUnAvailable (uiCmdAccessMode access_mode)
{
    return (ACCESS_UNAVAILABLE);
}
/*================================================================*\
FUNCTION: AccessRemove()(菜单项的访问权限设置:移除菜单项)
\*================================================================*/
static uiCmdAccessState AccessRemove (uiCmdAccessMode access_mode)
{
return (ACCESS_REMOVE);
}
/*================================================================*\
FUNCTION: ShowMessage() 菜单按钮1的动作函数
\*================================================================*/
int ShowMessage()
{
    ProFileName MsgFile;
ProStringToWstring(MsgFile, "DisplayMessage2.txt");
ProMessageDisplay(MsgFile, "Push button pressed");
return true;
}

点F7会出现下面错误
--------------------Configuration: proe_MenubarAdd - Win32 Debug--------------------
Compiling...
proe_MenubarAdd.cpp
Linking...
LINK : warning LNK4075: ignoring /INCREMENTAL due to /FORCE specification
LIBC.lib(crt0dat.obj) : warning LNK4006: _exit already defined in msvcrtd.lib(MSVCRTD.dll); second definition ignored
LIBC.lib(unlink.obj) : warning LNK4006: _remove already defined in msvcrtd.lib(MSVCRTD.dll); second definition ignored
LIBC.lib(crt0init.obj) : warning LNK4006: ___xc_z already defined in msvcrtd.lib(cinitexe.obj); second definition ignored
LIBC.lib(crt0init.obj) : warning LNK4006: ___xc_a already defined in msvcrtd.lib(cinitexe.obj); second definition ignored
LIBC.lib(crt0init.obj) : warning LNK4006: ___xi_z already defined in msvcrtd.lib(cinitexe.obj); second definition ignored
LIBC.lib(crt0init.obj) : warning LNK4006: ___xi_a already defined in msvcrtd.lib(cinitexe.obj); second definition ignored
LIBC.lib(crt0dat.obj) : warning LNK4006: _exit already defined in msvcrtd.lib(MSVCRTD.dll); second definition ignored
LIBC.lib(unlink.obj) : warning LNK4006: _remove already defined in msvcrtd.lib(MSVCRTD.dll); second definition ignored
LIBC.lib(crt0init.obj) : warning LNK4006: ___xc_z already defined in msvcrtd.lib(cinitexe.obj); second definition ignored
LIBC.lib(crt0init.obj) : warning LNK4006: ___xc_a already defined in msvcrtd.lib(cinitexe.obj); second definition ignored
LIBC.lib(crt0init.obj) : warning LNK4006: ___xi_z already defined in msvcrtd.lib(cinitexe.obj); second definition ignored
LIBC.lib(crt0init.obj) : warning LNK4006: ___xi_a already defined in msvcrtd.lib(cinitexe.obj); second definition ignored
   Creating library Debug/proe_MenubarAdd.lib and object Debug/proe_MenubarAdd.exp
LINK : warning LNK4098: defaultlib "msvcrtd.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "LIBC" conflicts with use of other libs; use /NODEFAULTLIB:library
protk_dll.lib(cu_appid.obj) : error LNK2001: unresolved external symbol __ftol2
protk_dll.lib(cttime.obj) : error LNK2001: unresolved external symbol __ftol2
protk_dll.lib(ctwcfun.obj) : error LNK2001: unresolved external symbol __ftol2
protk_dll.lib(ctfileutil.obj) : error LNK2001: unresolved external symbol __ftol2
protk_dll.lib(frgnalt3.obj) : error LNK2001: unresolved external symbol __ftol2
protk_dll.lib(windows_32.obj) : error LNK2001: unresolved external symbol __ftol2
protk_dll.lib(cu_dll_tools.obj) : error LNK2001: unresolved external symbol [email=_GetModuleFileNameExW@16]_GetModuleFileNameExW@16[/email]
protk_dll.lib(cu_dll_tools.obj) : error LNK2001: unresolved external symbol [email=_GetModuleInformation@16]_GetModuleInformation@16[/email]
protk_dll.lib(cu_dll_tools.obj) : error LNK2001: unresolved external symbol [email=_EnumProcessModules@16]_EnumProcessModules@16[/email]
LIBC.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/proe_MenubarAdd.dll : warning LNK4088: image being generated due to /FORCE option; image may not run
proe_MenubarAdd.dll - 10 error(s), 16 warning(s)
我是菜鸟,,大侠帮帮忙啊
对了,我用得是VC6.0+PROE3.0
请问这和版本有关吗
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖 赞一下!赞一下!
2
 楼主| 发表于 2009-7-17 13:56:09 | 只看该作者

马上注册,结交更多同行朋友,交流,分享,学习。

您需要 登录 才可以下载或查看,没有帐号?注册

x
您需要登录后才可以回帖 登录 | 注册

本版积分规则

3D打印手板模型快速制作服务,在线报价下单!

QQ 咨询|手机版|联系我们|iCAx开思网  

GMT+8, 2024-11-10 22:59 , Processed in 0.029869 second(s), 13 queries , Gzip On, Redis On.

Powered by Discuz! X3.3

© 2002-2024 www.iCAx.org

快速回复 返回顶部 返回列表