iobjects C++11i中,为什么在内存数据源中导入kml文件失败,在文件型数据源则可以导入。在iDesktop是可以在内存数据源导入kml文件的,是我创建的内存数据源不对吗?以下是我的代码:
//创建数据源实例对象
UGDataSource* memoryDs = UGDataSourceManager::CreateDataSource(UGEngineType::Memory);
//设置数据源连接信息
UGDsConnection pCon;
pCon.m_nType = UGEngineType::Memory;//数据源类型
pCon.m_strAlias = _U("memoryDs");
memoryDs->GetConnectionInfo() = pCon;
//创建数据源
UGbool s = memoryDs->Create();
m_pWorkspace->m_DataSources.Insert(_U("memoryDs"),memoryDs);
UGDataExchange exchange = UGDataExchange();
int issu = exchange.AttachDataSource(memoryDs);
UGKMLImportParams kmlParams = UGKMLImportParams();
kmlParams.SetDestDTName(_U("testKML"));
kmlParams.SetFilePathName(Translator::QStr2UGStr(qStrPath));
UGint ii = kmlParams.GetFileType();
//ss返回1
int ss = UGExchangeParamsManager::IsValidImportParams(ii, kmlParams);
//issucceed为-1
UGint issucceed = exchange.Import(kmlParams);