iCAx开思工具箱

标题: 【求助】生成二维视图中出现的问题。 [打印本页]

作者: C3P    时间: 2003-6-6 11:55
标题: 【求助】生成二维视图中出现的问题。
下面是一个生成二维视图的 c文件,编译时没错,链接时出现如下错误,请各位大侠帮忙,先谢了!
Linking...
DrawingFromTmpltCreate.obj : error LNK2001: unresolved external symbol _ProUtilWstrcpy
Debug/MouldCAD.dll : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
  
MouldCAD.dll - 2 error(s), 3 warning(s)
  
//UserDrawingCreateDemo.c
#include &ltroToolkit.h>
#include &ltroDrawing.h>
#include &ltroMdl.h>
#include <TestError.h>
#include "UtilString.h"
#include "roWstring.h"
#include "roUtil.h"
#include "DrawingFromTmpltCreate.h"
  
#define TEMPLATE_NAME "c_drawing"
/*==================================================================*\
FUNCTION: UserDrawingCreateDemo()
PURPOSE:  Creates a drawing for the current model.
\*==================================================================*/
  
  int UsrDrawingCreateDemo()
{
 &nbsproError      err;
 &nbsproMdl        solid_mdl;
 &nbsproMdlType    mdl_type;
 &nbsproMdldata    data;
 &nbsproModel      model;
  // ProFileName   msgfil;
  ProName       predefined_template;
  ProName       name;
  ProDrawing    created_drawing;
  ProDwgcreateOptions options = (ProDwgcreateOptions)0;
  ProDwgcreateErrs  errors;
    created_drawing = NULL;
  
/*------------------------------------------------------------------*\
  Set up the name of the message file.
\*------------------------------------------------------------------*/
  //ProStringToWstring (msgfil, "msg_ugdrawing.txt");
  
/*------------------------------------------------------------------*\
  Use the current model to create the drawing.
\*------------------------------------------------------------------*/
  err = ProMdlCurrentGet ([$solid_mdl)]  
  if (err != PRO_TK_NO_ERROR)
      return (err);
  err = ProMdlTypeGet (solid_mdl, [$mdl_type)]
  if (err != PRO_TK_NO_ERROR ||  
      (mdl_type != PRO_MDL_PART && mdl_type != PRO_MDL_ASSEMBLY))
       return PRO_TK_INVALID_TYPE;
    err = ProMdlDataGet (solid_mdl, [$data)]
  
  ProUtilWstrcpy(model.name,data.name);
  ProUtilWstrcpy (model.type,data.type);

/*------------------------------------------------------------------*\
  Initialize the template name.
\*------------------------------------------------------------------*/
  ProStringToWstring (predefined_template, TEMPLATE_NAME);
  
/*------------------------------------------------------------------*\
  Read in the root of the new name of the drawings to create.
\*------------------------------------------------------------------*/
  // err = ProMessageDisplay (msgfil, "USER Enter new drawing name: ");
  err = ProMessageStringRead (PRO_NAME_SIZE, name);
  if (err != PRO_TK_NO_ERROR)
      return (err);
  
/*------------------------------------------------------------------*\
  Create the required drawing.
\*------------------------------------------------------------------*/
  err = ProDrawingFromTmpltCreate (name, predefined_template,
                                    &model, options, &created_drawing,  
                                    [$errors)]
  if (err != PRO_TK_NO_ERROR || err != PRO_TK_DWGCREATE_ERRORS)
    return err;
  //if (err == PRO_TK_DWGCREATE_ERRORS)
   // {
      //ProMessageDisplay (msgfil,"USER Errors found when creating drawing %w", name);
   // }
  
  return (PRO_TK_NO_ERROR);
}
作者: TOOL    时间: 2003-6-6 17:21
 &nbsproUtilWstrcpy(model.name,data.name);  
 &nbsproUtilWstrcpy (model.type,data.type);  
  
这个是拷贝函数,试一下用类似功能函数代替……
作者: TOOL    时间: 2003-6-6 18:12
先ProWStringToString();
然后ProStringToWString();
作者: great    时间: 2003-6-17 20:58
ProUtilWstrcpy(model.name,data.name);  
ProUtilWstrcpy (model.type,data.type);  
这两句是Pro/E自己开发的函数,你可以找到他们的执行文件,include近来,
  
或者:
  
用这3句代替这2句,就好了。
char s[PRO_PATH_SIZE];
ProStringToWstring(model.name, ProWstringToString(s, data.name));
ProStringToWstring(model.type, ProWstringToString(s, data.type));
作者: TOOL    时间: 2003-6-17 22:35
和我想法一样:)
挺好的
作者: C3P    时间: 2003-6-18 16:51
实现了,谢谢以上大侠!
作者: zine    时间: 2003-6-20 13:53
这个通用吗?我以后用得上的,先copy一份。
作者: TOOL    时间: 2003-6-20 22:21
可以得
作者: great    时间: 2003-6-24 09:50
没问题,欢迎!




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