Skip to main content
Known Participant
March 9, 2009
Question

How to learn Indesign CS3 SDK programming for windows

  • March 9, 2009
  • 7 replies
  • 981 views
Hi,<br /><br />I am very new to plugin development.I am working in Indesign CS3 SDK (windows).<br /><br />But I am not able to write /understand the syntax of InterfacePtr.<br /><br />for eg :<br /><br />InterfacePtr<IClassIDData> orgDocFileHandlerData(doc, IID_ORGICLASSIDDATA); <br /><br />We get Pointer of any Interface , and pass some arguments .<br /><br />So can anybody help how to learn this programming , I am not finding any <br /><br />books or tutorials on this so that I can read from the basic. I have only <br /><br />referred to Programming Guide(CS3). Can anybody please help/explain me how <br /><br />to learn it?<br /><br />Thanks.<br /><br />Ravi Sharma
This topic has been closed for replies.

7 replies

Inspiring
March 11, 2009
Thanks Dirk for your correction. I mismatched boss/interface 'ref-count'. This stuff is not really easy to understand fully...
Known Participant
March 10, 2009
Thanks Jacques .It helped me to understand InterfacePtr.

Ravi Sharma
Known Participant
March 10, 2009
Thanks Dirk.

Ravi Sharma
Inspiring
March 9, 2009
Jacques wrote:

> InterfacePtr has a reference counter


> destroy the interface object - not the boss of course

No. There is only one relevant counter on the boss, thru IControllingUnknown. When the last reference is gone, the whole boss is flushed to the database if persistent and dirty, then purged. In the meantime, all instantiated interfaces remain stable.

What you might have in mind is the additional counter in HelperInterface, as used by CPMUnknown. It is for display/debug purposes only, and bracketed by #ifdef DEBUG.

Dirk

Edit: line break in quote
Inspiring
March 9, 2009
Tooting my own horn: I am running a workshop for people who want to start or get a better understanding of InDesign SDK/C++ programming, at the Adobe CSBU conference in May; it's aimed mainly at CS3/CS4.

For people who are already up to speed with C++ and InDy SDK, Movemen is also doing a few more advanced workshops...

More info here:

http://www.rorohiko.com/wordpress/indesign-sdk-training-may-11th-seattle-adobe-fremont-campus/

http://niemannross.host.adobe.com/2009csbuDeveloperSummit/

Cheers,

Kris Coppieters
Inspiring
March 9, 2009
It's only my way of understanding about InDesign SDK :<br /><br />* SDK objects are know as 'boss(es)' and are accessed thru interfaces.<br />* You can imagine object as collection of interfaces. And you can even aggregate new interfaces to existing objects.<br />* When you have a reference to an interface of a boss, you can access other interfaces (of the same boss - or object) using the *amazing* syntax : (here, doc is a probably an IDocument interface on a kDocBoss object, and you want to access it's IClassIDData interface)<br />InterfacePtr<IClassIDData> orgDocFileHandlerData(doc, IID_ORGICLASSIDDATA); <br />* And finally, InterfacePtr has a reference counter, which allows the framework to destroy the interface object - not the boss of course, only the memory used by the object - when it's non mre referenced.<br /><br />HTH !
Inspiring
March 9, 2009
Regarding the syntax, I recommend this book:
http://www.amazon.com/dp/0201700735

The source for InterfacePtr, including plenty comments, is in InterfacePtr.h

You can also compare principles of the object model with COM. http://en.wikipedia.org/wiki/Component_Object_Model#Interfaces

Re-reading the programming guide may be sufficient, though.

Dirk