Wow. This is very disheartening, to say the least.

Fortunately, I have 35 years programming experience, including 10
years with prior versions of Visual C++. This, of course, does not
allow me to do the first thing with Visual C++ 2008.

I am trying to do something apparently extremely complicated - pop up
a messagebox. After 3 hours, I was able to locate sample programs
(2008 specific) at the Microsoft site, since the code snippets I find
in the help files do not work. The Visual C++ installation did not
load any example code.

The code in the sample program also does not work, of course. In fact,
the sample does not even build (I am looking at something called polygon).

-------------------------------------------------------
Option 1 - The help file shows the construct

MessageBox::Show("The calculations are complete",
         "My Application", MessageBoxButtons::OKCancel,
         MessageBoxIcon::Asterisk);

which leads to the errors

1>.\BrewOrion.cpp(222) : error C2653: 'MessageBoxW' : is not a class
or namespace name
1>.\BrewOrion.cpp(223) : error C2653: 'MessageBoxButtons' : is not a
class or namespace name
1>.\BrewOrion.cpp(223) : error C2065: 'OKCancel' : undeclared identifier
1>.\BrewOrion.cpp(224) : error C2653: 'MessageBoxIcon' : is not a
class or namespace name
1>.\BrewOrion.cpp(224) : error C2065: 'Asterisk' : undeclared identifier
1>.\BrewOrion.cpp(222) : error C3861: 'Show': identifier not found

-------------------------------------------------
Option 2: The Polygon sample program uses

MessageBox(COLE2T(strError), _T("Error"), MB_ICONEXCLAMATION);
                        
which also fails - neither the _T or COLE2T words are recognized.

------------------------------------------
Option 3: I did manage to get this construct to pop up a message box:

MessageBox (NULL,(LPCWSTR)"Settings", (LPCWSTR)"My
Application",MB_ICONEXCLAMATION);

Unfortunately, all the strings are in Chinese characters:(

I assume that Option 1 needs some sort of include file or namespace
specification, although I can't find any reference to anything.

Option 2 didn't make any sense to me, since I could not find any spec
on MessageBox that looked like this interface.

In Option 3, I am assuming LPCWSTR means use Wide Chinese characters?
I couldn't come up with another casting type that would compile...

Any help on this would be appreciated:)

brew

Reply via email to