• 0

[VB.NET] Threading + MsgBox + destroy


Question

Hey gang,

I've got an interesting situation. We are using MapInfo's Map Marker and I've come across a bad issue with their software. When I pass in an address that it does not have instead of raising an error is throws a MsgBox. (what the?!!!) The reason this is a problem for us is that we are getting a live xml feed or addresses and the application is to be a Windows Service, so no user interaction. When this msgbox appears it log jams the process. So to fix the log jam I have thread the application. This insures that one bad xml file does not stop all the others from processing. However it would be nice to not have instance after instance of this class taking up memory until a user looks at the server (not a good technical solution)

SI created the following code to test if aborting a thread will kill a msgbox inside the called class (TestBox.vb) It does not kill the messagebox. ANY ideas?

Thanks

Dim thrTest As Threading.Thread

Dim objTestBox As New TestBox

thrTest = New Threading.Thread(AddressOf objTestBox.TestMsgbox)

With thrTest

.IsBackground = True

.Start()

If .Join(1500) = False Then

.Abort()

objTestBox = Nothing

End If

End With

End With

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Can we have a bit more code?

It is certainly a pain that they are throwing a message box instead of letting you catch and deal with the error. :s

Link to comment
Share on other sites

  • 0

The example I gave was just so it could be seen how the situation is basically within our code. That code is just a test bed to see if I could kill the msgbox when I abort the tread and destroy the class that called the msgbox. It didnt. :(

I simply can't believe that a creator of a consumable piece of software that costs many thousands of dollars would EVER allow an error to be thrown via a msgbox. But then, I've had to fight so many times to get other developers to use exception handling. So I guess nothing really surprises me.

Link to comment
Share on other sites

  • 0

this would be more of a cheesy workaround, but you could get winspy++ and see if you can find out the details about the buttons on the message box (or even the box itself). put a check somewhere in your code to see if that button (or box) is visible and send it a click.

also if the mapinfo program is .net based i do believe there is a program similar to winspy++ for .net (just can't remember the name of it)

Link to comment
Share on other sites

  • 0
this would be more of a cheesy workaround, but you could get winspy++ and see if you can find out the details about the buttons on the message box (or even the box itself). put a check somewhere in your code to see if that button (or box) is visible and send it a click.

also if the mapinfo program is .net based i do believe there is a program similar to winspy++ for .net (just can't remember the name of it)

MapInfo, the version we have, came out prior to .NET (yes, we need to update it!!!!!) The WinSpy is something I thought about... but it would be yet another app to be running to watch for that msgbox. (ug) or when our base app starts to process it would then check for the msgbox... in either case it concerns me that this msgbox exists. <sigh>

Thanks!

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.