Hot Door CORE Forum
pass-through SDK function access - Printable Version

+- Hot Door CORE Forum (http://hotdoorcore.com/forum)
+-- Forum: All forums (http://hotdoorcore.com/forum/forumdisplay.php?fid=1)
+--- Forum: Feature requests (http://hotdoorcore.com/forum/forumdisplay.php?fid=7)
+--- Thread: pass-through SDK function access (/showthread.php?tid=144)



pass-through SDK function access - Rick Johnson - 07-08-2017

Would it be practical to add a pass-through function to classes to allow access to SDK functions that don't have an explicit interface in the CORE header, as a simple alternative to building a hybrid project to access a few simple functions?

For example, hdicoreDocument.h offers activate() const while the underlying AIDocumentList.h has (*Activate)( AIDocumentHandle document, ASBoolean bSetFocus ); I'd like to use CORE to get the relevant DocumentHandle(s) and, for example, Activate with bSetFocus set to false, access the dictionary, the modified state, file path, or other document criteria without bringing that window frontmost (don't want to frighten users with screens suddenly flashing). I would imagine that our IDE's autocomplete would help show a list of available options as well as the Adobe SDK itself so a simple boilerplate disclaimer may suffice for documentation.


RE: pass-through SDK function access - garrett - 07-09-2017

In a strongly-typed language there is no reasonable way to do this; you would need to know the types that the underlying SDK function accepts, in which order, and hence need the true function declaration. At that point, you basically have a "hybrid" hdi_core and Ai SDK project.

In this case, if you need the argument for AIDocumentSuite::Activate() exposed, I'll try to get it into the next release of the lib.


RE: pass-through SDK function access - Rick Johnson - 07-10-2017

Thanks, Garrett. I was sure it'd be a long shot, but a killer class if it could work.

At this point, I don't personally need additional document class functions since I've already gone the hybrid route, but it may be helpful for others since, at least in the SDK, some functions work correctly only when the document is active. If you do update hdicoreDocument, I suspect others could use functions to retrieve properties such as modified, or the file's path and display name.