iCAx开思工具箱

标题: 【求助】proe二次开发遇到一个问题 [打印本页]

作者: TOOL    时间: 2002-12-13 15:12
标题: 【求助】proe二次开发遇到一个问题
#include &ltroMessage.h>
ProFileName mf;.
ProMessageDisplay(mf,"USER %0s","Success run promessage.");
  
error C2660: 'ProMessageDisplay' : function does not take 3 parameters
  
编译的时候,ProMessageDisplay函数老是出现类似这样的错误,如何解决???
程序按照给的例子来,也是出现这样的错误
作者: leeyee    时间: 2002-12-13 19:31
sorry, can't help you
作者: TOOL    时间: 2002-12-14 10:44
我以为终于有人回答了呢,555555555
作者: BOBYE    时间: 2002-12-14 18:09
乍樣進入開發
作者: EMeiMonkey    时间: 2002-12-16 10:30
ProMessageDisplay函数我用的时候就传了两个参数。你看看起声明:
extern ProError ProMessageDisplay(
#ifdef PRO_USE_VAR_ARGS
          ProFileName file_name,  
          ProCharLine message_name,
          ...
#endif
);
  
/*
  Purpose: Prints a text message to the Pro/ENGINEER message area, then  
          scrolls previous messages to make room for the new message.
      The function looks for the message name in the specified message
    file, which provides a mapping between the message name and the
    actual text of the message to be displayed.
  
     <p> This function takes 0 to 10 additional arguments to be
    substituted for conversion specifiers in the text of the message,
          similar to <i>printf()</i>.
  
<ul>
     <li>Default Values
     <p>  Specify default values in the call to ProMessageDisplay(), using the
          separator ||| in the format string in the message file. (See the  
         &nbspro/TOOLKIT User's Guide section Contents of the Message File for  
          the specific placement of the ||| separator.)
  
     <p><li>Message Classifications
  
     <p>  Messages displayed in Pro/ENGINEER include a symbol which identifies
          the message type. Each message type is identified by a  
          classification which begins with the characters %C. A message  
          classification requires that the message key (line 1 in the message
          file) be proceeded by the classification code.  
  
      <p><b>Note:</b>The message key string used in the code should NOT contain
                     the classification.  
  
        <p&gtro/TOOLKIT applications can now display any or all of these message
           symbols:
  
<ul>
     <p><li>
         &nbsprompt--the Pro/ENGINEER message displayed is preceded by a green   
          arrow. The user must respond to this message type (to either input  
          information, accept the default value offered, or cancel the  
          application). Without such action, no progress can be made. The  
          response may be either textual or in the form of a selection. The  
          classification code for Prompt messages is %CP.
    <p> <li>
          Info--the Pro/ENGINEER message displayed is preceded by a blue dot.  
          This message type contains information such as user requests or  
          feedback from either Pro/ENGINEER or the Pro/TOOLKIT application.
          The classification code for Info messages is %CI.
   <p>        
   <b>Note:</b> Do not classify as Info any message which informs users of a  
                problem with an operation or process. Classify these messages  
                as Warnings.
   <p><li>
          Warning--the Pro/ENGINEER message displayed is preceded by a tri-
          angle containing an exclamation point. Warnings alert the user to  
          situations which may lead to potentially erroneous situations at a  
          later stage, for example, possible process restrictions imposed or a
          suspected data problem. However, warnings do not prevent or  
          interrupt task completion, nor should they be used to indicate a  
          failed operation. Warnings only caution the user that the operation  
          has been completed, but may not have been performed in a completely  
          desirable way. The classification code for Warning messages is %CW.
     <p><li>
          Error--the Pro/ENGINEER message displayed is preceded by a broken  
          square. This message type informs the user when a required task was
          not successfully completed. It may or may not require intervention or
          correction before work can continue, depending on the application.  
          Whenever possible, provide a workaround. The classification code  
          for Error messages is %CE.
     <p><li>
          Critical--the Pro/ENGINEER message displayed is preceded by a red X.  
          This message type informs the user of extremely serious situations,  
          especially those which could cause the loss of user data. Options  
          for redressing the situation (if available) should be provided with  
          the message. The classification code for Critical messages is %CC.
</ul>
  
</ul>
  
  Input Arguments:
     file_name    - The name of the file that contains the message
     message_name  - The name of the message in the file
     ...                - The subsequent arguments for the values inserted
                          into the format string are pointers, not values.  
                          These values can be data inserted into the message
                          or default values for the data to be read from user
                          input. Although the list of arguments for the values
                          is variable in number, there is a maximum of 10.
  
  Output Arguments:
  
  Return Values:
    &nbspRO_TK_NO_ERROR    - The function successfully printed the message.
    &nbspRO_TK_E_NOT_FOUND   - The specified message file was not found.
    &nbspRO_TK_CANT_OPEN    - The system could not read the message file.
    &nbspRO_TK_MSG_NOT_FOUND - The specified message was not found in the  
                            message file.
    &nbspRO_TK_MSG_NO_TRANS  - The message text (in the current language of
               the user interface) was not found.
    &nbspRO_TK_MSG_FMT_ERROR - There was a format error in the message text.
    &nbspRO_TK_MSG_TOO_LONG  - The message was longer than (PRO_LINE_SIZE - 1)
               characters and has been truncated to fit.
     PRO_TK_GENERAL_ERROR - The message was not printed.
*/
作者: TOOL    时间: 2002-12-16 10:46
Input Arguments:  
     file_name    - The name of the file that contains the message  
     message_name  - The name of the message in the file  
     ... - The subsequent arguments for the values inserted  
                          into the format string are pointers, not values.  
                          These values can be data inserted into the message  
                          or default values for the data to be read from user  
                          input. Although the list of arguments for the values  
                          is variable in number, there is a maximum of 10.  
ProMessageDisplay可以传10个以下的参数的
我传两个参数,如:
ProMessageDisplay(msfil,"Anything");
也会出现以上的问题:
error C2660: 'ProMessageDisplay' : function does not take 2 parameters
  
束手无策呀,还望多指点
作者: ____    时间: 2002-12-16 12:20
试试后面的参数都用空来代替,就是说打满“,”号,不填内容。
作者: shjljg    时间: 2002-12-16 19:02
哇拷。都是高手啊。俺来灌灌水
作者: beibei    时间: 2003-3-15 10:08
这个问题我也遇到过,看protoolkit的帮助,message文件可以最多带9个参数。然而无论我是输入几个参数(2个、3个、4个),总是提示出错。
不知道那位大侠解决过这个问题,救救我吧!
作者: 风缘    时间: 2003-3-15 20:48
用这个函数时我也是一样碰到这个问题,因为也没有什么文本需要输出,只是显示一些调试信息。所有现在我索性不用了,直接用
AfxMessageBox
作者: 风缘    时间: 2003-3-15 21:00
对了,你要输出的文本在消息文件中有没有定义?看是不是这个问题
作者: 风缘    时间: 2003-3-15 21:13
用gjsmell提供的向导生成的工程不会出这个问题!
作者: TOOL    时间: 2003-3-15 21:29
风缘 wrote:
对了,你要输出的文本在消息文件中有没有定义?看是不是这个问题

  
定义了,不知道什么原因,比较奇怪
  
那个向导还没有正式用
还好用吗?
作者: mice    时间: 2003-3-16 11:40
把你的文件改为.C文件,如果用.cpp文件必须定义宏PRO_USE_VAR_ARGS,这两种办法都可以解决,我已经试过了。:8)
作者: weijians    时间: 2003-4-5 10:09
dui de




欢迎光临 iCAx开思工具箱 (https://t.icax.org/) Powered by Discuz! X3.3