Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
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>
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.