|
我寫了如下程式,在Acad2000,2002英文版可用,為什麼在另一PC(沒有安裝VC及OBJARX)上的ACAD2002中文版不可用,arxload 沒問題,運行時出錯.提示為:
*.arx ARX命令發生異常
未處理的異常E06D7363(e06d7363h),地址:77E69B01H.
ADS 請求錯誤.
程式如下請幫我看一下:
#include "StdAfx.h"
#include "StdArx.h"
// This is command 'FOXREAD'
int FOXREAD()
{
resbuf *pArg =acedGetArgs () ;
char *refname = "NetSend.mdb";
char fullpath[100];
if (acedFindFile(refname, fullpath) != RTNORM) return(RTNORM);
CDaoDatabase db;
db.Open(fullpath);
CDaoTableDef td(&db);
td.Open(pArg->resval.rstring);
CDaoRecordset rs;
rs.Open(&td,dbOpenTable,0);
char arrstr[150][22][20];
struct resbuf *head=0,*eb1=0,*eb2=0;
int j=0;
while(!rs.IsEOF())
{
eb1=new resbuf;
eb1->rbnext=NULL;
eb1->restype = RTLB;
if(eb2!=NULL)
{
eb2->rbnext=eb1;
eb2=eb1;
}
for(int i=0;irbnext=eb1;
eb2=eb1;
}
eb1=new resbuf;
eb1->rbnext=NULL;
strcpy(arrstr[j][i],V_BSTRT(&(rs.GetFieldValue(i))));
eb1->resval.rstring = arrstr[j][i];
eb1->restype = RTSTR;
eb2->rbnext=eb1;
eb2=eb1;
}
eb1=new resbuf;
eb1->restype = RTLE;
eb1->rbnext=NULL;
eb2->rbnext=eb1;
eb2=eb1;
rs.MoveNext();
j++;
}
rs.Close();
td.Close();
db.Close();
eb2->rbnext=NULL;
acedRetList(head);
delete(eb1);
return (RTNORM) ;
} |
|