Sub drawpoly1 (x,y,color)
' points(0).X = x-1-vga2
' points(0).Y = y-1-vga2
' points(1).X = x+1+vga2
' points(1).Y = y-1-vga2
' points(2).X = x+1+vga2
' points(2).Y = y+1+vga2
' points(3).X = x-1-vga2
' points(3).Y = y+1+vga2
' Form1.Polygon(points(),0,4,color)
rect1.X = x-1-vga2
rect1.Y = y-1-vga2
rect1.width = 2*(1+vga2)
rect1.height= 2*(1+vga2)
pen1.Color=color
drawer1.DrawRectangle(pen1.Value,rect1.value)
drawer1.Refresh2(rect1.Value)
End Sub
For j=0 To i
x=rx(wpte.Item(j))
y=ry(wptn.Item(j))
If (x>0) AND (x<formwidth) AND (y>0) AND (y<formheight) Then
Select wptcolor.Item(j)
Case 32
drawpoly1(x,y,cRed)
Case 31
drawpoly1(x,y,cGreen)
Case 30
drawpoly1(x,y,cWhite)
Case Else
drawer1.DrawRectangle2(pen1.Value,x-1,y-1,2,2)
'drawpoly1(x,y,cGray)
End Select
If cbwptid.Checked Then form1.DrawString(wptid.Item(j),7,x+2,y-4,x+100,y+20,cGray)
End If
Next
The nature of .NET means that the number of dlls is very unlikely to cause want unwanted interactions. Due to the very strict typing and lack of programmer accessible memory pointers complexity problems like we used to get with C/C++ applications just don't arise in .NET apps due to the strict type segregation.The problem seems to be hidden somewhere inside the complexity of the application, most likely with the high number of DLLs merged (it uses GPSDriver, Hardware, Formlib, HTTP, BinaryFile, Bitwise, Door, Colordialog, ControlsEx).
One thing to get used to is that .NET apps do not "crash" in the same sense as unmanaged apps can crash. I have not yet seen a true crash in a .NET app. However the .NET way of handling errors is to throw an exception. Any error, from access outside an arrray boundary to a file not found, will throw an exception. The old practice of returning an error value is used very infrequently in .NET. This is why ErrorLabel is provided to catch exceptions in Basic4ppc. If an ErrorLabel is not used in a Sub you get the "Continue Yes/No" message box. Unfortunately, as standard, the code in an ErrorLabel block cannot determine the cause of the exception. However using my Exceptions library would let you access the exception type and message programmatically to deal with yourself.Here is another sub that crashes.
pen1.Color=color
pen1.new(color)
I wonder if it is in fact the the Drawer, not the Pen. I can't really see how Pen.New1(color) could fail, as long as there is a Pen object there, but Drawer.New1(Form, Forelayer) saves a GDI Graphics object to use when drawing on the form. I wonder if switching to Fullscreen invalidates this Graphics. You could try another New1 on Drawer1 after the switch to test this.I As soon as I switch to Fullscreen mode (latest when I switch back) first the polygons I draw disappear and then the error comes up again. So there is still something wrong, but it seems to be related to the pen.
You would need to use AddObject("pen1", "Pen") to add back a disposed Pen to reuse it. The same applies to reuse any disposed object or control.tells me to do a pen1.dispose everytime, but then an immediate error appears asking for a non-referenced object.
Yes, quite a sophisticated one, worth reading about if (like me) you are interested in systems engineering. In fact the techincal detail of the implementation of the whole .NET Framework is an interesting example of an excellent total software system design.I assume there is a garbage collector that takes care?
The IDE is more forgiving than the optimising compiler ... It will as the IDE is a .NET 1.0 app and a VGA device always runs them with a virtual QVGA screen. This is not true for a .NET 2.0 app which is what optimised compilation generates, they are assumed to be VGA aware and are run as normal apps.On the device IDE the error does not seem to appear ... But this runs in non-VGA mode, though on a VGA device.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?