on 08-11-2015 12:11 AM
Hi,
I couldn't find a separate space for the COM SDK but I think this space is really similar and should get my problem fixed as well.
I recently started with the COM SDK and wanted to iterate over all the available folder and connections.
My current approach looks like this (I'm writing in C++):
// init & logon to the application works fine...
// printer function is just printing to cout
IApplicationPtr application.....
IConnectionsPtr connectionsPtr = application->GetConnections();
printer(connectionsPtr->GetCount()); // prints 4
for(int i = 0; i<= connectionsPtr->GetCount(); i++){
try{
IConnectionPtr connectionPointer = connectionsPtr.->Get_Item(i);
printer(connectionPointer->Name);
} catch (const _com_error& e){
// printException....
}
}
// and the same for UniverseFolders
IUniverseFoldersPtr folders = application->GetUniverseRootFolder()->GetFolders();
printer(folders->GetCount()); // prints 3
for(int i = 0; i<=folders->GetCount(); i++){
try{
IUniverseFolderPtr folderPointer = folders->Get_Item(i);
printer(folderPointer->Name);
} catch (const _com_error& e){
// printException....
}
}
The communication with the COM SDK seems to work because I can get the right count of folders and connections.
However as soon as I try to get the items I'll get a _com_error. I have tried with GetItem(i),Get_Item(i), Items[i].
The really strange what comes on top is for the connections I'll receive a com error telling me that there is no connection (No connection Found).
As soon I'll query the folders I'll receive a com error telling me that the parameter do not match (Invalid parameter: Index must be an integer or a string).
Also assume I have a connection called "shared" when I try to call GetItem("shared") everything works fine and I'll get the connection I want.
However I don't know the connection names.
I already could figure out that I could the folder or connection names by using the BI Query Builder and execute some fancy queries.
In case this is the only solution: How could I utilize the COM SDK (or any other SDK) to execute a query?
Any help on this really strange glitch is highly appreciated.
Thanks,
S
Anyone any ideas how to solve this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.