| View previous topic :: View next topic |
| Author |
Message |
merkark12 Advanced Cheater
Reputation: 0
Joined: 04 Jul 2007 Posts: 74 Location: In that program you just downloaded
|
Posted: Sun Jul 29, 2007 9:07 pm Post subject: [Visual c++] using IF |
|
|
well i just started vc++ express today and i made a simple program that will show your message that you typed in the text box. i also made it that if you dont type anything it'll show a message box. but whenever i run it no matter wat i type it makes the message box appear.
| Code: | private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) {
label1->Text = textBox1->Text;
if (textBox1->Text == (""));
{
MessageBox::Show("Enter something>.>");
} |
| Description: |
|
| Filesize: |
9.23 KB |
| Viewed: |
6622 Time(s) |

|
_________________
|
|
| Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Sun Jul 29, 2007 9:11 pm Post subject: |
|
|
| use strcmp for text, not ==
|
|
| Back to top |
|
 |
merkark12 Advanced Cheater
Reputation: 0
Joined: 04 Jul 2007 Posts: 74 Location: In that program you just downloaded
|
Posted: Sun Jul 29, 2007 9:19 pm Post subject: |
|
|
| Code: | 1>c:\users\mon\documents\visual studio 2005\projects\project2\project2\Form1.h(131) : error C2146: syntax error : missing ')' before identifier 'strcmp'
1>c:\users\mon\documents\visual studio 2005\projects\project2\project2\Form1.h(131) : error C2059: syntax error : ')'
1>c:\users\mon\documents\visual studio 2005\projects\project2\project2\Form1.h(131) : error C3861: 'strcmp': identifier not found |
i get that error when i try it i tried putting the ) and it still didn't work
_________________
|
|
| Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Sun Jul 29, 2007 9:21 pm Post subject: |
|
|
| you're using c++.NET not c++, that's why you can't make use of any useful functions, sorry.
|
|
| Back to top |
|
 |
merkark12 Advanced Cheater
Reputation: 0
Joined: 04 Jul 2007 Posts: 74 Location: In that program you just downloaded
|
Posted: Sun Jul 29, 2007 9:54 pm Post subject: |
|
|
o ok thx. is there a regular visual c++?
_________________
|
|
| Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Sun Jul 29, 2007 9:56 pm Post subject: |
|
|
| yes
|
|
| Back to top |
|
 |
Robotex Master Cheater
Reputation: 0
Joined: 05 Sep 2006 Posts: 378 Location: The pizza country!
|
Posted: Sun Jul 29, 2007 10:00 pm Post subject: |
|
|
add <string.h> to stdafx
_________________
ASM/C++ Coder
Project Speranza lead developer |
|
| Back to top |
|
 |
merkark12 Advanced Cheater
Reputation: 0
Joined: 04 Jul 2007 Posts: 74 Location: In that program you just downloaded
|
Posted: Sun Jul 29, 2007 10:04 pm Post subject: |
|
|
can you show me where to find it? i tried microsoft.com and i googled it
_________________
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Sun Jul 29, 2007 10:05 pm Post subject: |
|
|
That's managed C++. You'll need to install the platform SDK to actually develop anything Win32.
PS MessageBox::Show(textBox1->Text);
|
|
| Back to top |
|
 |
malfunction Grandmaster Cheater Supreme
Reputation: 0
Joined: 30 Jan 2007 Posts: 1015 Location: http://www.behindthecorner.com/
|
Posted: Mon Jul 30, 2007 2:11 am Post subject: |
|
|
if thats managed C++ i think theres 1 tut in the stickies...
_________________
|
|
| Back to top |
|
 |
DeletedUser14087 I post too much
Reputation: 2
Joined: 21 Jun 2006 Posts: 3069
|
Posted: Mon Jul 30, 2007 4:13 am Post subject: |
|
|
I think he expeted a link too
@ Topic starter
Why do you type in yellow ?
|
|
| Back to top |
|
 |
merkark12 Advanced Cheater
Reputation: 0
Joined: 04 Jul 2007 Posts: 74 Location: In that program you just downloaded
|
Posted: Mon Jul 30, 2007 9:14 am Post subject: |
|
|
idono i just think its bright enough for everyoen to see
_________________
|
|
| Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Mon Jul 30, 2007 5:36 pm Post subject: |
|
|
| Robotex wrote: | | add <string.h> to stdafx |
what he said
dont forget to add librarys that u need... choose the code definition window and then click the syntax. it should come up with up library u need.
_________________
|
|
| Back to top |
|
 |
|