|
System.Windows.Forms.MessageBox.Show
When used on "Web Application" actualy works on Visual Studio 2010 during debug runtime not a single warning or error.
Just to find out that once compiled and uploaded to be viewed online then you get ERROR saying it was only meant for local application. Then why the hell they don't even tell while you where debuging it took me about 4 hours to found this out.
you will get this error:
Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.
Beware of this .Net debuging st*p*d*ty! or maybe I was the problem
I was st*p*d to believe in some guy posting that this is better way to show message box on Web App.
|
|
|
|
|
You aren't the first to do that, and you won't be the last. I deal with maybe one Q&A question aasking "why doesn't this work anymore?" each week...
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
Developers often forget that to show a message box on the client computer, the code must be running on the client computer, but in case of a web app, the code runs on the web server. Use JavaScript's alert() to show message box in the browser.
|
|
|
|
|
Even worse are the possibilities that if this code did actually work, you now have a modal dialaog box open on the server waiting for user input. How many of those do you think can be spawned before some kind of memory error occurs?
-- modified 17-Jan-19 21:01pm.
|
|
|
|
|
I've come to a conclusion that the way that software get maintained, backed-up, ect. is a big problem area in computers today.
How many hours do I sometimes spend searching/downloading the correct revisions of software programs/libraries/functions. Lots of times the backed up files is found all over the place(Download something on this site, then that site and so on). We need a "mother system".
"Program testing can be used to show the presence of bugs, but never to show their absence."
<< please vote!! >>
|
|
|
|
|
But you have heard of something like source control before?
"I just exchanged opinions with my boss. I went in with mine and came out with his." - me, 2011
--- I am endeavoring, Madam, to construct a mnemonic memory circuit using stone knives and bearskins - Mr. Spock 1935 and me 2011
|
|
|
|
|
Revision Control, Source Control, I include all those subject in my statement.
There needs to be a simpler, language independant, structured, singular way of
doing these things. Its too much time consuming and unstructured. The data is
scattered on servers across world.
"Program testing can be used to show the presence of bugs, but never to show their absence."
<< please vote!! >>
|
|
|
|
|
Probably not in this universe, unless you hire a secretary to gather together all that stuff for you.
"I just exchanged opinions with my boss. I went in with mine and came out with his." - me, 2011
--- I am endeavoring, Madam, to construct a mnemonic memory circuit using stone knives and bearskins - Mr. Spock 1935 and me 2011
|
|
|
|
|
How about an interface, 1 interface controls all
"Program testing can be used to show the presence of bugs, but never to show their absence."
<< please vote!! >>
|
|
|
|
|
What do we have the MCP for
"I just exchanged opinions with my boss. I went in with mine and came out with his." - me, 2011
--- I am endeavoring, Madam, to construct a mnemonic memory circuit using stone knives and bearskins - Mr. Spock 1935 and me 2011
|
|
|
|
|
lol, yeah, the not so nice work part of being an MCP.
"Program testing can be used to show the presence of bugs, but never to show their absence."
<< please vote!! >>
|
|
|
|
|
I meant the Master Control Program from Tron
"I just exchanged opinions with my boss. I went in with mine and came out with his." - me, 2011
--- I am endeavoring, Madam, to construct a mnemonic memory circuit using stone knives and bearskins - Mr. Spock 1935 and me 2011
|
|
|
|
|
hehehehe, Exactly that.
"Program testing can be used to show the presence of bugs, but never to show their absence."
<< please vote!! >>
|
|
|
|
|
MCP, what else could that mean? Most Clueless Professional?
"I just exchanged opinions with my boss. I went in with mine and came out with his." - me, 2011
--- I am endeavoring, Madam, to construct a mnemonic memory circuit using stone knives and bearskins - Mr. Spock 1935 and me 2011
|
|
|
|
|
hahaha, you got it. Apparently made by Microsoft
"Program testing can be used to show the presence of bugs, but never to show their absence."
<< please vote!! >>
|
|
|
|
|
In near future Google is planning to give space to save your code online.
But your own project related code and documents, you have to maintain in your local server (TFS, VSS etc...), they are providing security.
-- Rushi
|
|
|
|
|
Here's a C code fragment that I recently came across. Not making this up!
if ( len >= 8 )
{
As you may understand, it took me a little while to figure this particular one out
modified on Tuesday, May 10, 2011 4:03 AM
|
|
|
|
|
I think such code should not be commented at all. I know someone who would comment
Such comments are really just littering your code with the obvious. It doubles development time and has no added value... If you need comments to understand that you are obviously not at your right place. A more helpful comment might be WHY the string must be at least 8 chars.
Your example is rather hilarious (or is that sad?) though
It's an OO world.
|
|
|
|
|
My point exactly, thanks. And not only does it double development time, it also puts a burden on the next programmer that has to maintain the code. What should (s)he do? Update the comment? Remove it altogether? In this example, the maintainer apparently forgot to update the comment.
|
|
|
|
|
Fred van Lieshout wrote: What should (s)he do? Update the comment? Remove it altogether?
Shoot the programmer who put the comment there?
It's an OO world.
|
|
|
|
|
Send out a memo saying everyone needs to start using Octal.
|
|
|
|
|
No, no, no. That's too simple.
Instead, send out a memo congratulating everybody on the positive response to the company-wide move to Octal, and gently reminding them that the two hold-outs will be receiving negative reviews this year.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
I say fix the comments and the code when and where needed!
Just because the code works, it doesn't mean that it is good code.
|
|
|
|
|
If I were to log a bug against it I'd say that "magic numbers were used".
Rather create a constant. Avoid magic numbers at all cost.
#define MAX_STR_LEN 10
public int main()
{
if (CheckStringLength)
{
}
else
{
}
return 0;
}
private boolean CheckStringLength(char* str)
{
boolean result = false;
unsigned int len = 0;
while(str++ != '\0')
{
len++;
}
if (len <= MAX_STR_LEN)
{
result = true;
}
else
{
result = false;
}
return result;
}
In actual fact it would of probebly been better to define the constant in a header file.
This way when the string length changes the actual source file doesn't change but just
the value of the constant defined in the header file and thus the testing of the source
file is not required again.
"Program testing can be used to show the presence of bugs, but never to show their absence."
<< please vote!! >>
modified on Wednesday, May 11, 2011 6:52 AM
|
|
|
|
|
Couldn't agree more. Thanks for the post!
|
|
|
|