马上注册登录,享用更多网站功能!
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
我的程序出现如下问题
--------------------Configuration: czh - Win32 Debug--------------------
Compiling...
czh.cpp
g:\ugapi\startup\czh\czh.cpp(31) : error C2146: syntax error : missing ';' before identifier 'action_table'
g:\ugapi\startup\czh\czh.cpp(31) : fatal error C1004: unexpected end of file found
执行 cl.exe 时出错.
czh.dll - 1 error(s), 0 warning(s)
我的源程序如下
帮帮忙把
//////////////////////////////////////////////////////////////////////////////
//
// czh.cpp
//
// Description:
// Contains Unigraphics entry points for the application.
//
//////////////////////////////////////////////////////////////////////////////
// Include files
#include <uf.h>
#include <uf_exit.h>
#include <uf_ui.h>
#if ! defined ( __hp9000s800 ) && ! defined ( __sgi ) && ! defined ( __sun )
# include <strstream>
# include <iostream>
using std:strstream;
using std::endl;
using std::ends;
using std::cerr;
#else
# include <strstream.h>
# include <iostream.h>
#endif
#include "czh.h"
//----------------------------------------------------------------------------
// Activation Methods
//----------------------------------------------------------------------------
static UF_MB_action_t action_table[] =
{
{ "create_model" ,create_model_callback,NULL},
//响应行为要和czh1men中的相同
{NULL,NULL,NULL}
};
static UF_MB_cb_status_t create_model_callback (UF_MB_widget_t widget,UF_MB_data_t client_data,
UF_MB_activated_button_p_t call_button)
//菜单响应行为函数定义
{
UF_MB_cb_status_t ret;
DisplayDialog ( ) ;
ret =UF_MB_CB_CONTINUE;
return(ret) ;
}
// Unigraphics Startup
// This entry point activates the application at Unigraphics startup
extern "C" DllExport void ufsta( char *param, int *returnCode, int rlen )
{
/* Initialize the API environment */
int errorCode = UF_initialize();
if ( 0 == errorCode )
{
/* TODO: Add your application code here */
UF_MB_add_actions(action_table);
//注册菜单响应行为
// errorCode = UF_ terminate ( ) ;
//释放API执行许可
/* Terminate the API environment */
errorCode = UF_terminate();
}
/* Print out any error messages */
PrintErrorMessage( errorCode );
}
//----------------------------------------------------------------------------
// Utilities
//----------------------------------------------------------------------------
// Unload Handler
// This function specifies when to unload your application from Unigraphics.
// If your application registers a callback (from a MenuScript item or a
// User Defined Object for example), this function MUST return
// "UF_UNLOAD_UG_TERMINATE".
extern "C" int ufusr_ask_unload( void )
{
return( UF_UNLOAD_UG_TERMINATE );
}
/* PrintErrorMessage
**
** Prints error messages to standard error and the Unigraphics status
** line. */
static void PrintErrorMessage( int errorCode )
{
if ( 0 != errorCode )
{
/* Retrieve the associated error message */
char message[133];
UF_get_fail_message( errorCode, message );
/* Print out the message */
UF_UI_set_status( message );
// Construct a buffer to hold the text.
ostrstream error_message;
// Initialize the buffer with the required text.
error_message << endl
<< "Error:" << endl
<< message
<< endl << endl << ends;
// Write the message to standard error
cerr << error_message.str();
}
} |