Error using MBS plugin

I’m getting and error message saying “There is more than one item with this name and it’s not clear to which this refers.” while running this code:

CallDelegateOnMainThreadMBS AddressOf App.Display

Where Display is a parameter less method of the App object … any ideas?

Are there several overloads of the Display method on your app instance ?

None

I assume Display is a public method on App ?
What kind of project ?

Display is a public method in App. The application is a very large UI intense nuclear power plant simulation, version 4 but the first written in XOJO.

first we’d need to reproduce it in a new project.
Can you do that?

App is the name of your app class?

I just put it in a sample project, and it works.

You are sure there is no property, constant or method with name display or anything named app in the project?

I can try, do we know it isn’t an issue with the MBS component?

there is nothing else in the project with the name of Display, but Project is a function not a sub, could that be the problem?

Display not Project, sorry

the error message is from xojo. The addressof operator doesn’t know which display to pick as you may have several.

I created a new desktop project
Added a method to App - display() as boolean
Then in the open event of window1 I put

dim p as ptr = addressof App.Display break
Thats about as simple as I can make this and be kind of close to what you’re seeing
There’s no compile error when I run this
So I’m at a bit of a loss as to what else might be causing the compiler to think that in your case there are several methods to select from leading the the error message

You’re close Norman, I took the sample app Christian sent me and just added an Integer return value to the Display method and got the error. In other languages the programs wait for functions to complete while continue to execute the next line of code for subs, is this true or false with XOJO? Does it even matter anymore in today operating systems?

this method from our plugin only takes subs, not functions. Sorry.

I created a sub version of my display method which updates the entire UI and everything is handled perfectly except buttons with icons. Is this a known weakness? Should I handle those in a different routine or a different way? It’s driving me nuts.

I’m still getting this error almost randomly when calling the same subroutine that accepts only one parameter (a string). It’s both baffling and irritating because there seems to be no pattern, just the error message. It happens on both Windows and Mac OS in the same places but I’m not sure what to even look for to find how to resolve the issue. Anyone have any ideas? Help!

I’ve just run into the same issue today myself with v2015 2.2, and 2.1
I get the bug on blank lines as well as actual lines of code.
ie all I have to do is add blank lines or put in extra lines of code

It looks more like something is corrupt.
Ive deleted and remade the sub.
But then the error message simply moves to a completely separate sub routine that had no error before.
I have restarted my machine twice.
I can’t compile or runny app now at all.
A bit stumped

I found my issue
I called super.constructor in a constructor of a subclass
which caused issues

I’m only seeing the issue rarely, the original problem was calling a function, but I 'm calling the sam sub throughout my program and only occasionally do I get the error message … still no idea why when calling a sub that works 99% of the time ?

Is the sub on a class? Ie is it a subclass?