can anyone help me, how to write c++ code to access items of a subfolder (of a subfolder)?
The example code is written in pascal and doesn`t solve my problem.
I don`t know COM-Programming very well. The truth is, it`s my first program with com objects.
I use the Borland C++Builder 5 Pro. I`ve imported the OE type library.
Now I can place a OE-server object on my form and have access to the exposed objects.
This already works:
I can reach the main folders:
ComboBox1->Text = MainOE1->GetFolder(i)->Caption;
The help system of oe tells me, to get the subfolders, I should use the Object GetItem.
IDispatch* pDisp = MainOE1->GetFolder(FolderNumber)->GetItem(i);
But now I don`t know, what to do further?
I dont really understand the IDispatch-Interface . Do I need knowledge about the IDispatch-Interface?
Maybe somebody can write a small example for me.
Thanks a lot for every hint.
Best regards,
Oleg Chernavin
MP Staff
private void PopulateProjectManager()
{
// parse master folders
for (int i = 0; i < _OE.FoldersCount; i++)
{
this.RecurseFolder(_OE.GetFolder(i));
}
}
/// <summary>
/// fetch info from each (sub)folder
/// </summary>
/// <param name="IFolder"></param>
private void RecurseFolder(OEFolder IFolder)
{
for (int i = 0; i < IFolder.ItemsCount; i++)
{
if (IFolder.ItemType(i) == OEClassType.OECT_Folder)
{
RecurseFolder((OEFolder)IFolder.GetItem(i));
}
else
{
IOEProject IProject = (IOEProject)IFolder.GetItem(i);
int length = lvwManager.Items.Count;
this.lvwManager.Items.Add(IProject.IID.ToString());
this.lvwManager.Items[length].SubItems.Add(IProject.Caption);
this.lvwManager.Items[length].SubItems.Add(IProject.URL);
this.lvwManager.Items[length].SubItems.Add(IProject.UserName);
this.lvwManager.Items[length].SubItems.Add(IProject.Password);
this.lvwManager.Items[length].SubItems.Add("todo");
this.lvwManager.Items[length].SubItems.Add(IProject.Level.ToString());
this.lvwManager.Items[length].SubItems.Add("todo");
this.lvwManager.Items[length].SubItems.Add("todo");
this.lvwManager.Items[length].SubItems.Add("todo");
// load specific data
LoadDataPerIID(IProject.IID);
}
}
}