Copy link to clipboard
Copied
Hi all,
I am developing InDesign plugin via C++ SDK. So I want to know the idea of constructor parameters of objects.
Sample 01:
If someone wants to create IActiveContext, Then I saw they used ISubject.
InterfacePtr<IActiveContext> context(iSubj, UseDefaultIID());So I want to know why they use ISubject for construct IActiveContext here?
Sample 02:
InterfacePtr<IStrokeAttributeSuite> strokeAttributeSuite(selectionManager, UseDefaultIID());How to identify IStrokeAttributeSuite needs to be passed ISelectionManager for construct IStrokeAttributeSuite.
These two are only samples. but I have to implement alot of object types. So Is there any hierarchy of objects? or any document to refer about this?
Read about boss classes, boss classes can be thought of as a collection of classes. So whenever you want to get an instance of an interface, you just need to get hold of some interface that lies in the same boss class as this wanted interface and then you can create an instance of your required interface using the syntax you used. Without getting into too much details lets discuss your example broadly
InterfacePtr<IActiveContext> context(iSubj, UseDefaultIID());
Now in this you need IActiveConte
...Copy link to clipboard
Copied
Read about boss classes, boss classes can be thought of as a collection of classes. So whenever you want to get an instance of an interface, you just need to get hold of some interface that lies in the same boss class as this wanted interface and then you can create an instance of your required interface using the syntax you used. Without getting into too much details lets discuss your example broadly
InterfacePtr<IActiveContext> context(iSubj, UseDefaultIID());
Now in this you need IActiveContext, so check which boss class aggregates this interface. Then see what other interfaces are present in this boss class, you can use any one of these interface instead of iSubj, provided you have an instance of that interface. Now mostly the code is written in classes that makes these patterns almost same, for ex if you are writing a controller implementation then you are inside a kDoc boss and have access to its interface so you can navigate the whole kdoc boss hierarchy using that
Read the programming guide shipped with the sdk present in the docs folder. That is only documentation present
-Manan.
Copy link to clipboard
Copied
Thanks Manan. Now sorted that.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more