Skip to main content
Participating Frequently
January 9, 2009
Question

[Win - CS4] Command not able to read it's own data - very simple but not working annoying

  • January 9, 2009
  • 3 replies
  • 304 views
I have the following very simple code that used to work with CS3 and now it is not working with CS4 Any clues would be greatly helpful.<br /><br />In my command's implementation do() method tried to get new data from command....<br /><br />InterfacePtr<IPicUpdaterPrefsData> newData(this, UseDefaultIID());<br /><br />// newData comes out to be NULL<br /><br />When I try to execute the command and do is called I always get newData as nil. Any ideas ?<br /><br />thanks<br /><br />My .fr file has following code.<br /><br />Class<br />{<br />kPicUpdaterSetPrefsCmdBoss,<br />kInvalidClass,<br />{<br />IID_ICOMMAND, kPicUpdaterSetPrefsCmdImpl,<br />IID_IPICUPDATERPREFSDATA, kPicUpdaterPrefsDataImpl,<br />}<br />},<br /><br />Class<br />{<br />kPicUpdaterIteratorRegisterBoss,<br />kInvalidClass,<br />{<br />IID_ICONTENTITERATORREGISTER, kPicUpdaterIteratorRegisterImpl,<br />IID_IK2SERVICEPROVIDER, kContentIteratorRegisterServiceImpl,<br />}<br />},<br /><br />AddIn<br />{<br />kWorkspaceBoss,<br />kInvalidClass,<br />{<br />IID_IPICUPDATERPREFSDATA, kPicUpdaterPrefsDataPersistImpl<br />}<br />},
This topic has been closed for replies.

3 replies

gshwetaAuthor
Participating Frequently
January 12, 2009
Okay I don't know if that makes sense or not but if I change the UseDefaultIID() to my Interface ID it is working fine.

Thanks
gshwetaAuthor
Participating Frequently
January 9, 2009
- Breakpoint shows valid and I can break into the do() function of the command.<br /><br />More weird is when I try to create the command the data seems to be fine...<br /><br />InterfacePtr<ICommand> setPrefsCmd(CmdUtils::CreateCommand(kPicUpdaterSetPrefsCmdBoss));<br />InterfacePtr<IPicUpdaterPrefsData> prefsData(setPrefsCmd, UseDefaultIID());<br />if (prefsData == nil)<br />{ break; }<br /><br />//set all data here...<br /><br />but when I do CmdUtils::ProcessCommand(setPrefsCmd)<br /><br />I see that the prefsData pointer is nil in the do() method.<br /><br />Thanks for the reply.
Participating Frequently
January 9, 2009
Some ideas:

Are you using the debug build?

Set a breakpoint in your command. When you reach that, set a breakpoint in the *Data code (e.g. the constructor). Does the breakpoint icon show like a valid breakpoint, or only like unresolved/missing code? If so then revisit your factory list.

Verify your classes resource that there is no #if around the IID_IPICUPDATERPREFSDATA.

Check the IDs, are the ID.h files found by C++ and resource compiler the same?

Dirk