Concerning the following problem
>System.NullReferenceException: Object reference not set to an instance of an object
> at System.Windows.Forms.ListView+ItemControl.ItemsMouseDown (System.Object sender, >System.Windows.Forms.MouseEventArgs me) [0x00000] in <filename unknown>:0
Other mentionned bugs should have been reported elsewhere for other bugs (duplicates ?)
Ubuntu 15.04
+ OpenBVE 1.4.0.9-1 as installed
I reproduce this bug each time i try to select a route with the mouse (not with the keyboard)
After having tried to localize the problem with monoDevelop, i think i've found something that could cause the problem
When i read the source code, i see
OpenBve/OldCode/formMain.Start.cs,
>Calling this method causes the current thread to be suspended while all waiting window messages are processed. If a message >causes an event to be triggered, then other areas of your application code may execute. This can cause your application to >exhibit unexpected behaviors that are difficult to debug.
What i see is that removing this instruction (Application.DoEvent call) seems to remove the problem and allowing to show the route.
As i'm not a premium developper i'm not directly going to change the code for OpenBve.
If anyone could validate or not the code ??
---------- Code suggested
private void ShowRoute(bool UserSelectedEncoding) {
if (Result.RouteFile != null) {
this.Cursor = Cursors.WaitCursor;
if (!Program.CurrentlyRunningOnMono) { // disabled code on Mono because it makes crash
Application.DoEvents();
} ]...[
I think there a t least 3 problems reported here
Concerning the following problem NullReferenceEx ception: Object reference not set to an instance of an object Windows. Forms.ListView+ ItemControl. ItemsMouseDown (System.Object sender, >System. Windows. Forms.MouseEven tArgs me) [0x00000] in <filename unknown>:0
>System.
> at System.
Other mentionned bugs should have been reported elsewhere for other bugs (duplicates ?)
Ubuntu 15.04
+ OpenBVE 1.4.0.9-1 as installed
I reproduce this bug each time i try to select a route with the mouse (not with the keyboard)
After having tried to localize the problem with monoDevelop, i think i've found something that could cause the problem
When i read the source code, i see OldCode/ formMain. Start.cs,
OpenBve/
private void ShowRoute(bool UserSelectedEnc oding) { .DoEvents( );
if (Result.RouteFile != null) {
this.Cursor = Cursors.WaitCursor;
Application
]...[
C# Microsoft documentation suggests this code (Application. DoEvent call ) could cause problems /msdn.microsoft .com/en- US/library/ system. windows. forms.applicati on.doevents% 28v=vs. 110%29. aspx
https:/
You will find many posts on many forums about this topic
>Calling this method causes the current thread to be suspended while all waiting window messages are processed. If a message >causes an event to be triggered, then other areas of your application code may execute. This can cause your application to >exhibit unexpected behaviors that are difficult to debug.
What i see is that removing this instruction (Application. DoEvent call) seems to remove the problem and allowing to show the route.
As i'm not a premium developper i'm not directly going to change the code for OpenBve.
If anyone could validate or not the code ??
---------- Code suggested oding) { CurrentlyRunnin gOnMono) { // disabled code on Mono because it makes crash n.DoEvents( );
].. .[
private void ShowRoute(bool UserSelectedEnc
if (Result.RouteFile != null) {
this.Cursor = Cursors.WaitCursor;
if (!Program.
Applicatio
}