Programming Question please help with InputBox character limit

Mr Martian

Orbinaut/Addon dev/Donator
Addon Developer
Donator
Joined
Jun 6, 2012
Messages
382
Reaction score
254
Points
78
Location
Sydney, Australia, Earth, Sol
Website
www.orbithangar.com
hey i am trying to make an MFD that orients a vessel so that it points towards a base, but i cant type any base name longer than 20 characters using the "oapiOpenInputBox" function. i tried making the character limit 80 by doing this:
Code:
 oapiOpenInputBox("Select Base", cbSelectBase, 0, 80, 0);
but when i type a base name longer than 20 characters and click enter, Orbiter crashes...

any help would be greatly appreciated :cheers:

thanks in advance

- MrMartian
 
Last edited:
Instead of inputboxes, in this Orbit MFD's clone there's the code to create pop up menus:
[ame="http://www.orbithangar.com/searchid.php?ID=3609"]Free Orbit MFD 1.2[/ame]
 
Instead of inputboxes, in this Orbit MFD's clone there's the code to create pop up menus:
Free Orbit MFD 1.2
It's a hack and it may stop working in future versions of Orbiter. The code of the hack is provided there, but the methodology describing how to adapt the hack to the future versions of Orbiter isn't documented there.
 
The code of the hack is provided there, but the methodology describing how to adapt the hack to the future versions of Orbiter isn't documented there.

See this post and attached source.

It's not really difficult, there is an unexported function in the core and FreeOrbitMFD is calling it (and in my case, I was detouring it). Adapting to the next version boils down to locating the new function address -- this takes a few minutes with IDA (provided of course that the function is still there).

Although, we could simply ask martins to export that function in the next release...

---------- Post added at 10:55 AM ---------- Previous post was at 10:37 AM ----------

Code:
 oapiOpenInputBox("Select Base", cbSelectBase, 0, 80, 0);
but when i type a base name longer than 20 characters and click enter, Orbiter crashes...

Maybe we should introduce a rule that people simply saying "it crashes" should post the full code of the add-on.

Just saying.
 
Back
Top