NX二次开发 UFUN读写txt文件 UFUN打开文件 uc4504
//NX8.0+VS2010
#if ! defined ( __hp9000s800 ) && ! defined ( __sgi ) && ! defined ( __sun )
# include <strstream>
# include <iostream>
using std::ostrstream;
using std::endl;
using std::ends;
using std::cerr;
#else
# include <strstream.h>
# include <iostream.h>
#endif
#include <uf.h>
#include <uf_ui.h>
#include <uf_exit.h>
#include <uf_cfi.h>
#include <string>
//#include <NXSigningResource.cpp>
using namespace std;
using std::ostrstream;
extern DllExport void ufsta(char* param, int* returnCode, int rlen)
{
if (UF_initialize())
return;
int omode = 3;//1 = 读丶2 = 写丶3 = 写入替换丶4 = 追加丶6 = 打印机
int ftype = 79;//文件后缀名txt(UG英文帮助文档里有详细说明"File Types and Extensions")
char txt[257] = "D:\\ug_meilei_temp.txt";//文件路径
int p = uc4504(txt, omode, ftype);//打开文件,omode = 3写入替换,