Skip to main content
JADarnell
Inspiring
January 11, 2008
Question

IDCS3 Mac - Not able to generate a MulticolumnTextFrame

  • January 11, 2008
  • 2 replies
  • 266 views
Hello everyone: <br /><br /> I have the following code in my plugin (Please note that for brevity's sake I have removed all of the tests, but be reassured that all InterfacePtrs get created just fine):<br /><br /> // Now we need to see if it all fits on one page or not<br /> InterfacePtr<IStoryList> storyList (doc, IID_ISTORYLIST);<br /><br /> int32 numStories = storyList -> GetUserAccessibleStoryCount(); // should be one<br /> UIDRef storyRef = storyList -> GetNthUserAccessibleStoryUID(0); // because there is only one<br /><br /> InterfacePtr<ITextModel> textModel(storyRef, IID_ITEXTMODEL);<br /><br /> InterfacePtr<IFrameList> frameList(textModel -> QueryFrameList());<br /><br /> UID textFrameUID = frameList -> GetNthFrameUID(0);<br /> UIDRef textFrameRef = UIDRef (db, textFrameUID);<br /><br /> InterfacePtr<IMultiColumnTextFrame> multitextFrame(db, textFrameUID, UseDefaultIID()); //multitextFrame is NULL<br /> if (multitextFrame == nil)<br /> {<br /> ASSERT_FAIL("Cannot obtain Multi Text Frame");<br /> break;<br /> }<br /><br />The IMultiColumnTextFrame does not get instantiated and when it is tested, so when the variable is tested for nil, the test is evaluated to true and the ASSERT_FAIL message is published and the code breaks from the rest of the do {} while() loop.<br /><br />textFrameUID has a value that *looks* appropriate (216), db is filled without any error, and the final argument is fairly straightforward. Does anyone see why my multitextFrame is not getting instantiated?<br /><br />TIA!<br />John
This topic has been closed for replies.

2 replies

JADarnell
JADarnellAuthor
Inspiring
January 16, 2008
Thanks, Dirk. That solved the problem. Take care.
Inspiring
January 12, 2008
Use IDatabase::GetClass to determine the class ID of your UIDRef.
In most cases you'll find it to be a kFrameItemBoss.
Then the parent (via IHierarchy) is a kMultiColumnItemBoss.

Dirk