iCAx开思工具箱

标题: [新手求助] Pro/E的动态链接 [打印本页]

作者: sky-w    时间: 2007-1-4 22:11
标题: [新手求助] Pro/E的动态链接
张继春的动态链接实例,代码输入编译后出现这样的问题:
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",&param1);
  ProParameterInit(&feature,L"PITCH",&param2);
  ProParameterInit(&feature,L"ANGLE",&param3);
  ProParameterInit(&feature,L"WIDTH",&param4);

  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(&param1,&value1);
  ProParameterValueSet(&param2,&value2);
  ProParameterValueSet(&param3,&value3);
  ProParameterValueSet(&param4,&value4);

  ProSolidRegenerate((ProSolid)part,PRO_B_TRUE);
  ProMdlDisplay(part);
}
搞了很久查不出什么原因,请各位高手指点啊!
作者: 457128405    时间: 2012-4-12 21:52
你好
你这个问题当时是怎么解决的~我也遇到了

作者: api163    时间: 2012-4-14 16:27
MainPTC.cpp 文件里 第22行 少了一个 ;
作者: Mcuikai    时间: 2012-4-14 22:25
不懂,帮顶!




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