EnTerr
Roku Guru

SetMessagePort() without ifSetMessagePort... how/why?

I am utterly befuddled by this. I was under the impression that ALL BRS components have their methods implemented by way of BRS interfaces. I seem to recollect somewhere it was saying components are just a collection of interfaces and nothing else.

But here is example of it not being the case. By documentation, roParagraphScreen has ifSetMessagePort - but not in practice:
BrightScript Debugger> para = CreateObject("roParagraphScreen")
BrightScript Debugger> ? para
<Component: roParagraphScreen>
BrightScript Debugger> ? getInterface(para, "ifSetMessagePort")
invalid
BrightScript Debugger> para.SetMessagePort(invalid)
BrightScript Debugger> para.ifSetMessagePort.SetMessagePort(invalid)
Interface not a member of BrightScript Component (runtime error &hf3) in $LIVECOMPILE(152)
Same is the case with roListScreen, roCaptionRenderer and probably more.

You can set the port with SetMessagePort() but the interface ifSetMessagePort is not there, how is that possible?

On the other hand, roUrlTransfer delivers on the promise of ifSetMessagePort - and so do many (most?) others:
BrightScript Debugger> url = CreateObject("roUrlTransfer")
BrightScript Debugger> ? getInterface(url, "ifSetMessagePort")
<Interface: ifSetMessagePort>
BrightScript Debugger> url.ifSetMessagePort.setMessagePort(invalid)
BrightScript Debugger> url.setMessagePort(invalid)
BrightScript Debugger>
Tags (1)
0 Kudos
Community is Temporarily in Read-Only Mode!

We’re upgrading Roku Community to bring you a faster, more mobile-friendly experience. You may notice limited functionality or read-only access during this time. You will not be able to log in or post new comments or kudos during this time. Read more here.

Planned Downtime:
Community will be unavailable for up to 24–48 hours during the upgrade window during the week of May 12 and you may notice reduced functionality. In the meantime, for additional assistance, visit our Support Site.

Thanks for your patience — we’re excited to share what’s next!