Problem with Menu Item Collection? Or Collections in general

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

krsh007
User
Posts: 17
Joined: Wed Sep 02, 2009 6:19 am

Problem with Menu Item Collection? Or Collections in general

Post by krsh007 »

Hi,

The code snipet below works fine as long as it belongs to "Standard Bars" as available. As soon as a customized bar comes into play the "COUNT" is always 0 and therefore the collection of menu items is not acessible - this is relevant when trying to use a customized configuration - please also refer to my other post related to the undo command.

Similar strange behaviour can be observed for all style collections - the code snippets from documentation are obviously wrong - it is impossible to get all this information into the containing application - please refer to section 2.2.2.5.9.1 in documentation and similar samples...

I thought that this might be a restriction when running the SDK in demo mode, thus without dev and license codes - now these codes have been obtained and nothing changes with the above mentioned. Please help.

Cheers,
Klaus
{
object DataOut;
ax.GetProperty("View.Bars.Count", out DataOut);
for (int i = 0, Count = (int)DataOut; i < Count; i++)
{
ax.GetProperty("View.Bars[" + i + "].ID", out DataOut);
int ID = (int)DataOut;
ax.GetProperty("View.Bars[" + i + "].NAME", out DataOut);
string NAME = (string)DataOut;
ax.GetProperty("View.Bars[" + i + "].VISIBLE", out DataOut);
int VISIBLE = (int)DataOut;

BarItem b = new BarItem(ID, NAME, VISIBLE);
Items[ID] = b;

ax.GetProperty("View.Bars[#" + b.ID + "].ITEMS.COUNT", out DataOut);

if ((int)DataOut > 0)
{
MenuItem First = null;
MenuItem Last = null;
for (int j = 0, Count2 = (int)DataOut; j < Count2; j++)
{
ax.GetProperty("View.Bars[#" + b.ID + "].ITEMS[" + j + "].ID", out DataOut);
MenuItem m = new MenuItem((int)DataOut);
if (j == 0)
First = Last = m;
else
Last.NEXT = m;
Last = m;
}
b.FIRST = First;
}
}
}
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2448
Joined: Thu Jun 30, 2005 4:11 pm

Re: Problem with Menu Item Collection? Or Collections in general

Post by Vasyl - PDF-XChange »

The code snipet below works fine as long as it belongs to "Standard Bars" as available. As soon as a customized bar comes into play the "COUNT" is always 0 and therefore the collection of menu items is not acessible - this is relevant when trying to use a customized configuration - please also refer to my other post related to the undo command.
Similar strange behaviour can be observed for all style collections - the code snippets from documentation are obviously wrong - it is impossible to get all this information into the containing application - please refer to section 2.2.2.5.9.1 in documentation and similar samples...
Fixed in both cases. Thanks.
Wait for next build.
PDF-XChange Co. LTD (Project Developer)

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.