UGDataExchange data;
UGDataExchange exchange = UGDataExchange();
//UGDataSource* ds = pWorkspace->OpenDataSource(Translator::QStr2UGStr(path), Translator::QStr2UGStr(strFileName), UGEngineType::ExtFile);
UGDataSource* ds = pWorkspace->GetDataSource(0);
if (!ds)
{
QMessageBox::information(NULL, QString::fromLocal8Bit("导入shp"), QString::fromLocal8Bit("导入失败"), QMessageBox::Close, QMessageBox::Close);
return;
}
int issu = exchange.AttachDataSource(ds);
UGShapeImportParams importparams = UGShapeImportParams();
importparams.SetDestDTName(Translator::QStr2UGStr(strFileName));
importparams.SetFilePathName(Translator::QStr2UGStr(path));
UGint ii = importparams.GetFileType();
int ss = UGExchangeParamsManager::IsValidImportParams(ii, importparams);
UGint issucceed = exchange.Import(importparams);
if (issucceed == 1)
{
QMessageBox::information(NULL, QString::fromLocal8Bit("导入shp"), QString::fromLocal8Bit("导入成功"), QMessageBox::Yes, QMessageBox::Yes);
}
else
{
QMessageBox::information(NULL, QString::fromLocal8Bit("导入shp"), QString::fromLocal8Bit("导入失败"), QMessageBox::Close, QMessageBox::Close);
}
为什么导入矢量文件时import函数的返回值为-1