|
马上注册,结交更多同行朋友,交流,分享,学习。
您需要 登录 才可以下载或查看,没有帐号?注册
x
张继春的动态链接实例,代码输入编译后出现这样的问题:
F:\protoolkit\dll\PTC\MainPTC.cpp(22) : error C2146: syntax error : missing ';' before identifier 'TestAccessDefault'
F:\protoolkit\dll\PTC\MainPTC.cpp(22) : fatal error C1004: unexpected end of file found
原代码是这样的:
#include "ProToolkit.h"
#include "ProObjects.h"
#include "ProMdl.h"
#include "ProMenu.h"
#include "ProMenuBar.h"
#include "ProMessage.h"
#include "ProUtil.h"
#include "ProCore.h"
#include "ProParameter.h"
#include "ProModelitem.h"
#include "ProSolid.h"
#include "ProWindows.h"
#include "TestError.h"
#include "UtilMessage.h"
#include "TestEParams.h"
#include "import.h"
#include "stdafx.h"
#include "TestSect.h"
#include "UtilString.h"
static uiCmdAccessState TestAccessDefault(uiCmdAccessMode access_mode)
{
return (ACCESS_AVAILABLE);
}
extern "C" void user_terminate()
{
}
extern "C" int user_initialize(int argc,char *argv[],
char *proe_vsn,char *build,wchar_t err_buff[])
{
void *cmd_id;
ProName wmsgfil;
ProStringToWstring(wmsgfil,"utilities.txt");
ProCmdActionAdd("gear1",(uiCmdCmdActFn)Load_Dlg,
uiProe2ndImmediate,NULL,PRO_B_TRUE,
PRO_B_TRUE,&cmd_id);
ProMenubarmenuPushbuttonAdd("Utilities","gear","-Gear Design",
"Gear Design help","Utilities.psh_util_aux",PRO_B_TRUE,cmd_id,wmsgfil);
return (0);
}
void Load_Dlg()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
Box* m_pBox=new Box();
LoadDlg(m_pBox);
ProMdl part;
ProParameter param1;
ProParameter param2;
ProParameter param3;
ProParameter param4;
ProParamvalue value1;
ProParamvalue value2;
ProParamvalue value3;
ProParamvalue value4;
ProModelitem feature;
int i;
int teethnum1;
double pitch1,angle1,width1;
ProMdlRetrieve(L"E:\\ProE二次开发实用教程\\第五章\\5.2\\GEAR\\parts\\spur_gear.prt.1",PRO_MDL_PART,&part);
ProMdlIdGet(part,&i);
ProModelitemInit(part,i,PRO_PART,&feature);
ProParameterInit(&feature,L"TEETH",¶m1);
ProParameterInit(&feature,L"PITCH",¶m2);
ProParameterInit(&feature,L"ANGLE",¶m3);
ProParameterInit(&feature,L"WIDTH",¶m4);
value1.type=PRO_PARAM_INTEGER;
value1.value.i_val=m_pBox->c;
value2.type=PRO_PARAM_DOUBLE;
value2.value.d_val=1/m_pBox->m;
value3.type=PRO_PARAM_DOUBLE;
value3.value.d_val=m_pBox->y;
value4.type=PRO_PARAM_DOUBLE;
value4.value.d_val=m_pBox->k;
ProParameterValueSet(¶m1,&value1);
ProParameterValueSet(¶m2,&value2);
ProParameterValueSet(¶m3,&value3);
ProParameterValueSet(¶m4,&value4);
ProSolidRegenerate((ProSolid)part,PRO_B_TRUE);
ProMdlDisplay(part);
}
搞了很久查不出什么原因,请各位高手指点啊! |
|