Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


error C2872: 'MessageBox' : ambiguous symbol
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
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?

PostPosted: Tue Aug 26, 2008 10:22 pm    Post subject: error C2872: 'MessageBox' : ambiguous symbol Reply with quote

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
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
kitterz
Grandmaster Cheater Supreme
Reputation: 0

Joined: 24 Dec 2007
Posts: 1268

PostPosted: Tue Aug 26, 2008 10:23 pm    Post subject: Reply with quote

Are you saying managed as in CLR/.NET?
Back to top
View user's profile Send private message Send e-mail
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Tue Aug 26, 2008 10:25 pm    Post subject: Reply with quote

Yea. CLR.
_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
kitterz
Grandmaster Cheater Supreme
Reputation: 0

Joined: 24 Dec 2007
Posts: 1268

PostPosted: Tue Aug 26, 2008 10:26 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Tue Aug 26, 2008 10:27 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
kitterz
Grandmaster Cheater Supreme
Reputation: 0

Joined: 24 Dec 2007
Posts: 1268

PostPosted: Tue Aug 26, 2008 10:28 pm    Post subject: Reply with quote

It has multiple overloads...there is no hWnd either.

http://msdn.microsoft.com/en-us/library/system.windows.forms.messagebox.show.aspx

Edit: Just remember that it is not a char* or string value, but rather a String^
Back to top
View user's profile Send private message Send e-mail
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Tue Aug 26, 2008 10:34 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Zand
Master Cheater
Reputation: 0

Joined: 21 Jul 2006
Posts: 424

PostPosted: Tue Aug 26, 2008 10:41 pm    Post subject: Reply with quote

Just what is
Code:
OK
??

Code:
MB_OK


Very Happy
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Tue Aug 26, 2008 10:46 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Zand
Master Cheater
Reputation: 0

Joined: 21 Jul 2006
Posts: 424

PostPosted: Tue Aug 26, 2008 11:11 pm    Post subject: Reply with quote

Use StringToHGlobalAnsi
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Wed Aug 27, 2008 12:08 am    Post subject: Reply with quote

Recommending C# since managed C++ is disgusting.
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Wed Aug 27, 2008 12:12 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Wed Aug 27, 2008 2:16 am    Post subject: Reply with quote

Environment.NewLine

... I think.
Back to top
View user's profile Send private message
kitterz
Grandmaster Cheater Supreme
Reputation: 0

Joined: 24 Dec 2007
Posts: 1268

PostPosted: Wed Aug 27, 2008 8:07 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Wed Aug 27, 2008 8:28 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites