- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Because this is not a spelling contest, we will start with the PreTEST, go <i>throught</i> the course and then take the PostTest.
Test early and test often because we have lots of bugs to fix.
Admin
Boggling over why you would do a windows form message box on web app. (or did I miss something)?
Admin
I develop locally all the time, and it never, ever occurred to me to use Windows Forms as part of my web apps. I guess this is the sort of thing that happens when developers work in isolation.
Admin
There's some JavaScript in your RSS item for this entry, you might want to fix that.
Other than that, keep the funny code coming!
Admin
The beep was funny as hell, but this is just atrocious. Kinda makes me wonder if the developer unit tested, or had this QA'ed. Same thing with windows services. NO MSGBOXES!.....
Jake, I truly feel your pain!
Admin
Yeah.. combined with the other two threads, it has created an interesting scenerio...
Good thing was that these horrible code snippets could easily be taken out without any refactoring or crazy modifications..
Admin
Tell me that this was developed in a college cirriculum... :^)
Admin
If I was feeling charitable, I could suggest that it was just message box debugging by someone who doesn't know how to use a debugger properly...
...nah.
Of course in VB6 you basically had to do this because your program ran in a totally different environment in the debugger - you weren't actually testing your compiled code. Still, not a great idea. You can use the VC++ debugger, but even with symbolic debug information built for the program/DLL, you couldn't see what the heck was going on.
Admin
"Of course in VB6 you basically had to do this because your program ran in a totally different environment in the debugger "
Mike - take a look at the OutputDebugString API along with using the SysInternals debug monitor. Much easier to output this info, and use its info to debug than attaching a debugger, also less nasty than forgetting a debug msgbox in prod code......
http://www.sysinternals.com/ntw2k/freeware/debugview.shtml
Public Declare Sub OutputDebugString Lib "kernel32" Alias "OutputDebugStringA" (ByVal lpOutputString As String)
Admin
This is truly baffling. At least it beeps to let someone near the server know they need to OK the message box ;)
I can only imagine talking to the writer of this code... "Platform? This has nothing to do with politics!... Tier? What do you mean?... Oh, I see, you're crying."
Admin
Maybe the messagebox was in the spec!
(Although I'm sure Jake, being the bitch with the spec would've filled us in on that.)
Admin
This code isn't a problem. Homer Simpsons had already found a solution:
http://science.howstuffworks.com/question608.htm
Admin
Strange, that code should work. Straight from MSDN: "ServiceNotification: The message box is displayed on the active desktop". Clearly the active desktop is the one with the user's browser.
[/sarcasm]
Admin
Um... actually the code to show a modal dialog is MessageBox.Show, not msgbox, and since you can't instantiate the MessageBox class (it only has the one static method), msgbox.Show isn't a reference to that method.
Maybe msgbox is a custom webcontrol like this one: http://home.telkomsa.net/businessware/DotNet/Development/MsgBox/Article/Article_Web.html?
Admin
fgb (Michael),
If Msgbox is infact a custom web control, then having it take parameters from the System.Windows.Forms namespace is indeed a WTF of its own. But I think you're giving too much credit! Knowing this coder, he probably did "Dim msgbox As System.Windows.Forms.MessageBox" to make it easier to reference. That would also explain why it's not MsgBox.
Admin
I bet you he uses MessageBox so much he did this:
using msgbox=System.Windows.Forms.MessageBox;
now he can do msgbox.Show();
Admin
Or the coder simply doesn't know how to use static methods, so he/she instantiated the class just to use static methods.
Admin
That's a big problem I have with VB.NET...accessing static methods off of an instance. It makes absolutely no sense.
Admin
Anyone notice the Clearing of the Viewstate (which, for those not well versed in ASP.NET, is a INPUT TYPE=HIDDEN form element) before redirecting? Rather pointless if you'd ask me!
Admin
Actually in VB.NET there is a function called MsgBox defined in the Microsoft.VisualBasic namespace. There's lots of old VB functions in there as well.
Admin
On top of everything else, there's this:
When your answer is incorrect (2), you get a single messagebox saying your answer is incorrect.
When your answer is correct (1), you get two messageboxes - the first one saying you are incorrect!