cancel
Showing results for 
Search instead for 
Did you mean: 

How to obtain all UniverseFolders and Connections using Designer COM SDK with C++

Former Member
0 Kudos

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

see:

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Anyone any ideas how to solve this?