| View previous topic :: View next topic |
| Author |
Message |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Tue Aug 26, 2008 10:22 pm Post subject: error C2872: 'MessageBox' : ambiguous symbol |
|
|
I'm making a program with managed C++ (x_x I know) and when I try using MessageBox, I get this error:
| Quote: |
error C2872: 'MessageBox' : ambiguous symbol
|
I am including windows.h. _________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
kitterz Grandmaster Cheater Supreme
Reputation: 0
Joined: 24 Dec 2007 Posts: 1268
|
Posted: Tue Aug 26, 2008 10:23 pm Post subject: |
|
|
| Are you saying managed as in CLR/.NET? |
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Tue Aug 26, 2008 10:25 pm Post subject: |
|
|
Yea. CLR. _________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
kitterz Grandmaster Cheater Supreme
Reputation: 0
Joined: 24 Dec 2007 Posts: 1268
|
Posted: Tue Aug 26, 2008 10:26 pm Post subject: |
|
|
You must use
| Code: | | Messagebox::Show (); |
This game me the same error too. It took me like 1 hour to figure out the solution. |
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Tue Aug 26, 2008 10:27 pm Post subject: |
|
|
Lol thanks. Same parameters? _________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
kitterz Grandmaster Cheater Supreme
Reputation: 0
Joined: 24 Dec 2007 Posts: 1268
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Tue Aug 26, 2008 10:34 pm Post subject: |
|
|
Ok how do I put an OK button in there? I looked up the constants but I'm getting an error using the OK constant:
| Quote: |
------ Build started: Project: pIM Server, Configuration: Debug Win32 ------
Compiling...
pIM Server.cpp
c:\documents and settings\oib\my documents\visual studio 2008\projects\pim server\pim server\Form1.h(155) : error C2065: 'OK' : undeclared identifier
c:\documents and settings\oib\my documents\visual studio 2008\projects\pim server\pim server\Form1.h(164) : error C2065: 'OK' : undeclared identifier
c:\documents and settings\oib\my documents\visual studio 2008\projects\pim server\pim server\Form1.h(170) : error C2065: 'OK' : undeclared identifier
c:\documents and settings\oib\my documents\visual studio 2008\projects\pim server\pim server\Form1.h(176) : error C2065: 'OK' : undeclared identifier
c:\documents and settings\oib\my documents\visual studio 2008\projects\pim server\pim server\Form1.h(184) : error C2065: 'OK' : undeclared identifier
c:\documents and settings\oib\my documents\visual studio 2008\projects\pim server\pim server\Form1.h(191) : error C2065: 'OK' : undeclared identifier
Build log was saved at "file://c:\Documents and Settings\OIB\My Documents\Visual Studio 2008\Projects\pIM Server\pIM Server\Debug\BuildLog.htm"
pIM Server - 6 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
|
Example of MessageBox::Show
| Code: |
//heres one of mine
MessageBox::Show("WSAStartup failed!", "Error", OK);
|
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
Zand Master Cheater
Reputation: 0
Joined: 21 Jul 2006 Posts: 424
|
Posted: Tue Aug 26, 2008 10:41 pm Post subject: |
|
|
Just what is ??
 |
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Tue Aug 26, 2008 10:46 pm Post subject: |
|
|
Yeah, but I figured it out. But I'm wondering how I can use the send API (for Winsock). It says it cant convert a managed type (String^) to an unmanaged type (char*). _________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
Zand Master Cheater
Reputation: 0
Joined: 21 Jul 2006 Posts: 424
|
Posted: Tue Aug 26, 2008 11:11 pm Post subject: |
|
|
| Use StringToHGlobalAnsi |
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Wed Aug 27, 2008 12:08 am Post subject: |
|
|
| Recommending C# since managed C++ is disgusting. |
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Wed Aug 27, 2008 12:12 am Post subject: |
|
|
Just a question. How do you write a new line to an edit box? _________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Wed Aug 27, 2008 2:16 am Post subject: |
|
|
Environment.NewLine
... I think. |
|
| Back to top |
|
 |
kitterz Grandmaster Cheater Supreme
Reputation: 0
Joined: 24 Dec 2007 Posts: 1268
|
Posted: Wed Aug 27, 2008 8:07 am Post subject: |
|
|
| oib111 wrote: | | Just a question. How do you write a new line to an edit box? |
Do you mean as in write to a editbox?
If so, then...you have to remember it is managed.
NameOfEditBox->Text = "This is a Line";
Or if you mean MultiLined...there is a propery, and you use the statement
NameOfEditBox->Text += "\r\nThis is another Line";
Last edited by kitterz on Wed Aug 27, 2008 9:00 am; edited 1 time in total |
|
| Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Wed Aug 27, 2008 8:28 am Post subject: |
|
|
Just make it Multi-Lined and add a \r\n at the end of a line?
Anyways i agree with slovach, use C# for this, C++.NET is just horrible. _________________
|
|
| Back to top |
|
 |
|