strange behavior in .Net/C# ??

G

genc ymeri

Hi,
I just noticed that while trying to run this code :

MessageBox.Show("Hello");

the message box pops up but shows no string/message in it. (expecting the
"Hello" string). Even the "OK" string in the button itself in dialog box
doesn't show.

I tried to write "Hello" string in the caption/text of the button or the
form text itslef

this.text = "hello"

but nothing changes.

I ran it from "outsite" (not from MS Studio IDE) and it does the same thing.
I unistalled and installed the .Net 1.1 Framework but the problem appears
and disappears randomly.......

It may be others thing they may not work properly, I just can't notice all
of them but this was obvious.

Any idea ?
 
M

Martin Stainsby

genc ymeri said:
Hi,
I just noticed that while trying to run this code :

MessageBox.Show("Hello");

the message box pops up but shows no string/message in it. (expecting the
"Hello" string). Even the "OK" string in the button itself in dialog box
doesn't show.


It needs a little bit more info.
MessageBox.Show
("Hello","Goodbye",MessageBoxButtons.OK,MessageBoxIcon.Information);
 
P

Peter van der Goes

Martin Stainsby said:
It needs a little bit more info.
MessageBox.Show
("Hello","Goodbye",MessageBoxButtons.OK,MessageBoxIcon.Information);
It's minimal, but syntactically and logically correct. The OP should be
getting a dialog with "Hello" as the message and everything else defaulted.
 
T

Tom Clement

This is very weird. You are calling MessageBox.Show properly. It seems
like some sort of string resource problem inside the .NET framework. Does
this reproduce in a simple project? Are you running on a separate thread
from the main application thread?

Tom Clement
Apptero, Inc.
 
P

Peter van der Goes

genc ymeri said:
Hi,
I just noticed that while trying to run this code :

MessageBox.Show("Hello");

the message box pops up but shows no string/message in it. (expecting the
"Hello" string). Even the "OK" string in the button itself in dialog box
doesn't show.

I tried to write "Hello" string in the caption/text of the button or the
form text itslef

this.text = "hello"

but nothing changes.

I ran it from "outsite" (not from MS Studio IDE) and it does the same thing.
I unistalled and installed the .Net 1.1 Framework but the problem appears
and disappears randomly.......

It may be others thing they may not work properly, I just can't notice all
of them but this was obvious.

Any idea ?
Your first code statement works correctly here in three different Visual
Studio .NET 2003 development environments, leading me to the conclusion that
there must be something very wrong on your PC.
I suggest applying all security patches to your OS if you have no already
done so, scanning with an up-to-date virus scanner and checking your system
for malware using tools like SpyBot and AdAware. Once you're sure you're
clean, then uninstall and reinstall both the .NET Framework and VS. NET.
Brutal, I know, but you have something causing erratic behavior.
 
G

genc ymeri

Your first code statement works correctly here in three different Visual
Studio .NET 2003 development environments, leading me to the conclusion
that
there must be something very wrong on your PC>>>>>>>>>

yeah,,, It started while parsing some XML files and it drove me
"creazy" b/c I was not getting any values at all, so I tried the
MessageBox.Show("Hello"). No text did show up.

So I opened a new project dropping a single button and onClick event I
wrote the same thing

string s = "hello";
MessageBox.Show("Hello");
MessageBox.Show(s);

No text did show up in both of my above commands. Then I wrote a simple
app to run it through console,
....
console.write("hello");string s = "hello";console.write(s);
this did work fine.

I went back to my simple win project with a single button on it, and it
showed the same problem.

Not sure what it is, but I do have NAV & LavaSoft running daily, and a
deticated team to catch these problems. Yes something is wrong in my PC
b/c my simple samples run fine in other PCs.

Not sure what it is.

Thanks a lot.

Ghenz.

Software Engineer
QuadraMed Corp.
Reston.VA
 
R

Richard Blewett [DevelopMentor]

Stupid question, but you haven't accidently changed your Dialog Text Color to the same as your Dialog Color have you?

Regards

Richard Blewett - DevelopMentor

http://staff.develop.com/richardb/weblog

nntp://news.microsoft.com/microsoft.public.dotnet.languages.csharp/<#[email protected]>

Your first code statement works correctly here in three different Visual
Studio .NET 2003 development environments, leading me to the conclusion
that
there must be something very wrong on your PC>>>>>>>>>

yeah,,, It started while parsing some XML files and it drove me
"creazy" b/c I was not getting any values at all, so I tried the
MessageBox.Show("Hello"). No text did show up.

So I opened a new project dropping a single button and onClick event I
wrote the same thing

string s = "hello";
MessageBox.Show("Hello");
MessageBox.Show(s);

No text did show up in both of my above commands. Then I wrote a simple
app to run it through console,
...
console.write("hello");string s = "hello";console.write(s);
this did work fine.

I went back to my simple win project with a single button on it, and it
showed the same problem.

Not sure what it is, but I do have NAV & LavaSoft running daily, and a
deticated team to catch these problems. Yes something is wrong in my PC
b/c my simple samples run fine in other PCs.

Not sure what it is.

Thanks a lot.

Ghenz.

Software Engineer
QuadraMed Corp.
Reston.VA



---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.760 / Virus Database: 509 - Release Date: 10/09/2004



[microsoft.public.dotnet.languages.csharp]
 
G

genc ymeri

I do see the MessageBox. I do not see the string message in it.

cody said:
Maybe you are using a popup blocker which prevents MessageBoxes to show up.

--
cody

[Freeware, Games and Humor]
www.deutronium.de.vu || www.deutronium.tk
genc ymeri said:
Your first code statement works correctly here in three different Visual
Studio .NET 2003 development environments, leading me to the conclusion
that
there must be something very wrong on your PC>>>>>>>>>

yeah,,, It started while parsing some XML files and it drove me
"creazy" b/c I was not getting any values at all, so I tried the
MessageBox.Show("Hello"). No text did show up.

So I opened a new project dropping a single button and onClick event I
wrote the same thing

string s = "hello";
MessageBox.Show("Hello");
MessageBox.Show(s);

No text did show up in both of my above commands. Then I wrote a simple
app to run it through console,
...
console.write("hello");string s = "hello";console.write(s);
this did work fine.

I went back to my simple win project with a single button on it, and it
showed the same problem.

Not sure what it is, but I do have NAV & LavaSoft running daily, and a
deticated team to catch these problems. Yes something is wrong in my PC
b/c my simple samples run fine in other PCs.

Not sure what it is.

Thanks a lot.

Ghenz.

Software Engineer
QuadraMed Corp.
Reston.VA
 
G

genc ymeri

hmmmm fair question but no, I haven't. Also now randomly, (specially when
I change the focus from onether app to my sample app) the text sometimes
shows up ,,,,,,)

thnx



Richard Blewett said:
Stupid question, but you haven't accidently changed your Dialog Text Color
to the same as your Dialog Color have you?
Regards

Richard Blewett - DevelopMentor

http://staff.develop.com/richardb/weblog
nntp://news.microsoft.com/microsoft.public.dotnet.languages.csharp/ said:
Your first code statement works correctly here in three different Visual
Studio .NET 2003 development environments, leading me to the conclusion
that
there must be something very wrong on your PC>>>>>>>>>

yeah,,, It started while parsing some XML files and it drove me
"creazy" b/c I was not getting any values at all, so I tried the
MessageBox.Show("Hello"). No text did show up.

So I opened a new project dropping a single button and onClick event I
wrote the same thing

string s = "hello";
MessageBox.Show("Hello");
MessageBox.Show(s);

No text did show up in both of my above commands. Then I wrote a simple
app to run it through console,
...
console.write("hello");string s = "hello";console.write(s);
this did work fine.

I went back to my simple win project with a single button on it, and it
showed the same problem.

Not sure what it is, but I do have NAV & LavaSoft running daily, and a
deticated team to catch these problems. Yes something is wrong in my PC
b/c my simple samples run fine in other PCs.

Not sure what it is.

Thanks a lot.

Ghenz.

Software Engineer
QuadraMed Corp.
Reston.VA



---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.760 / Virus Database: 509 - Release Date: 10/09/2004



[microsoft.public.dotnet.languages.csharp]
 
R

Ravichandran J.V.

Just MessageBox.Show("Hello"); will work. It does not require any
additional parameters.

If there is no virus etc., check by reinstalling the framework.

with regards,


J.V.Ravichandran
- http://www.geocities.com/
jvravichandran
- http://www.411asp.net/func/search?
qry=Ravichandran+J.V.&cob=aspnetpro
- http://www.southasianoutlook.com
- http://www.MSDNAA.Net
- http://www.csharphelp.com
- http://www.poetry.com/Publications/
display.asp?ID=P3966388&BN=999&PN=2
- Or, just search on "J.V.Ravichandran"
at http://www.Google.com
 
H

Hans Kesting

genc said:
hmmmm fair question but no, I haven't. Also now randomly,
(specially when I change the focus from onether app to my sample app)
the text sometimes shows up ,,,,,,)

thnx

If you use a long text in your messagebox, is the box wider?
(or to put it in different words: is it trying to display an empty string or
an invisible string?)

Hans Kesting
 
D

Damian Fernandez

Hi, well don't be alone with your pain...I've the same strange
behavior...

And I've all the os patchs and updates...nothing works!.

The most strange is that the rest of the environment work well...

Somebody help us...please!.
 
D

Damian Fernandez

Hi...me again!.

I find the solution...Desinstall the McAffe Enterprise 8...
go back to the 7.1 version.

The files instaled by the Mc 8, corrupt some common dlls...

I did it and works OK!.

Damian.
 
G

genc ymeri

Oh man,,,,

Thank you very much for figuring out that MC Afee causes the problems. I
asked my company a brand new PC and they gave it to me. No more than 2-3
days ago the problems started to appear again. I really had no
explanation, neither the force to complain again about it.

What I did I installed the latest updates of .Net framework and the
problem seemed to appear somehow less than usually, but once it started
I had to reboot my PC.

Once again, thanks a lot for sharing your experience.

Ghenz


Software Engineer
QuadraMed Corp.
Reston.VA
 
J

Jim

Tks a lot. I Just try to repair VS.NET 2003 and didnt work. So I came
here and see the answer and Yes i have updated McAfee from 7 to 8 too.

Tks a lot.

Jim
 
S

SGM SGM

I ran into the same problem. At the start of the program, all
messageboxes were empty, but at some point they started showing just
fine. Doing a little debug, I noticed that just after the following
lines the problem disappeared:

ManagementClass Network = new
ManagementClass("Win32_NetworkAdapterConfiguration");
ManagementObjectCollection Interfaces = Network.GetInstances();
// You must add a reference to System.Managment in order to make this
work
// It might work as well with any other kind of management class

So I just put these lines at the start of the application, and
everything works fine. By the way, does this make any sense to anybody?
If someone knows why, please let me know.

Uninstaling McAfee seems to solves the problem, but those that use your
program might not know or want to uninstal McAfee.
 
D

Damian Fernandez

You are right about that, some user might don’t want to uninstall the
McAfee, that’s why I report the incident to Microsoft and McAfee
DevTeam. Boot compromise to resolve the problem right away.

Regards,

Damian.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top