How to get a given Core Interface?

Home Forums General How to get a given Core Interface?

Tagged: ,

This topic contains 0 replies, has 1 voice, and was last updated by  Anonymous 10 months ago.

Viewing 1 post (of 1 total)
  • Author
  • #119

    myrian studio

    Interfaces are provided by objects. To get a given interface for a given object, your need to already have an interface on a related object, for example the parent object. Then you call either QueryInterface or a specific method of the related object.

    For example, if you are in a custom viewport and you want an interface on the parent view (ISDKViewInfo), you can simply call ISDKViewportInfo::QueryInterface(MKUID(ISDKViewInfo),(void**)&ptr). Because the viewport is a child of the view, it will forward the QueryInterface call to the view and return the required interface.

    In the viewportaddon project, you have a sample viewport defined vpinfopanel.cpp that will display the application object hierarchy with all the corresponding interfaces. That is also a good starting point to figure out where you can find an interface.

    Object Hierarchy

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.