[Tutorial]How to do Hello World in VC++ 2008

C / C++ Discuss, [Tutorial]How to do Hello World in VC++ 2008 at Programmers Lounge forum; Hey, everyone. Today I'm going to show you how to do Hello world with a label, and a button. First ...


Go Back   Gamerz Needs - For All Your Gaming Needs! > Technology Zone > Programmers Lounge > C / C++
Forgot Password? | Sign Up!

Notices

Advertisement
   

Reply
 
Bookmark this Thread Tools Display Modes
  #1  
Old 08-26-2008, 02:44 AM
kb3z0n's Avatar
Double Wood Axe
 
Last Online: 10-22-2008 10:37 AM
Join Date: Aug 2008
Posts: 29
Thanks: 0
Thanked 3 Times in 3 Posts
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
Latest Blog:
Rep Power: 0
kb3z0n is on a distinguished road
Points: 493.30
Bank: 0.00
Total Points: 493.30
Wink [Tutorial]How to do Hello World in VC++ 2008

Hey, everyone. Today I'm going to show you how to do Hello world with a label, and a button.

First off. The button is going to change the text of the label to say "Hello World".

Ok lets get started. First create a new program called Hello world, Make sure its a Win32 form Application. As seen here.




Next, Your going to drag a Button and a Label onto the Form, Change the Button Text and form1 Text to Hello world in the Properties. Leave label1 text label1.



Re Arange everything on the Form1 design to the way you want.
Next, Double click the button you should see :



Now scroll up a bit, until you see

Code:
this->label1->AutoSize = true;
this->label1->Location = System::Drawing::Point(48, 92);
this->label1->Name = L"label2";
this->label1->Size = System::Drawing::Size(35, 13);
this->label1->TabIndex = 2;
this->label1->Text = L"label1";
Now that you see

Code:
this->label1->Text = L"label1";
Change the
Code:
L"label1";
to
Code:
L"";
The reason we did that instead of in the properties is because, It's hard to see the label after the text is changed to Nothing, So Make sure it was where you wanted it!

Next, Double click the button again, you should see

Code:
#pragma endregion
	private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
			 }
	};
}
Don't worry this isn't hard at all,

Now Put this code into it.

Code:
This->label1->text = "Hello World";
So it will look like



Now Press F5, to Run the program you should get no errors!

Now, Press the button and watch the label text change to Hello world!


Now thats all, for now~

Credits to me for tut.

Last edited by kb3z0n; 08-26-2008 at 02:47 AM..
  #2  
Old 08-26-2008, 03:07 AM
ItsGreg's Avatar
<span style="color: red;">&lt;span style=&quot;color: red;&quot;&gt;Mustache Mucho&lt;/span&gt;</span>
 
Last Online: Today 12:35 PM
Join Date: Sep 2007
Location: 46°21′50.14″N, 15°3′28.69″E
Age: 14
Posts: 1,385
Donation Award 
Blog Entries: 5
Thanks: 123
Thanked 397 Times in 150 Posts
Nominated 8 Times in 6 Posts
TOTW/F/M Award(s): 0
Latest Blog: My info
Rep Power: 7
ItsGreg is on a distinguished road
Points: 10,365.10
Bank: 510,492.30
Total Points: 520,857.40
Send a message via MSN to ItsGreg
gj. but this can easily be found anywhere. i learnt it on youtube^^
__________________
  #3  
Old 08-26-2008, 03:31 AM
kb3z0n's Avatar
Double Wood Axe
 
Last Online: 10-22-2008 10:37 AM
Join Date: Aug 2008
Posts: 29
Thanks: 0
Thanked 3 Times in 3 Posts
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
Latest Blog:
Rep Power: 0
kb3z0n is on a distinguished road
Points: 493.30
Bank: 0.00
Total Points: 493.30
Lol, i searched around to find it, i learned myself. By looking @ this->label1->Text = L"label1";
  #4  
Old 08-26-2008, 12:49 PM
1k Points Wasted
 
Last Online: Yesterday 02:08 PM
Join Date: Aug 2006
Location: over there
Posts: 2,219
Blog Entries: 6
Thanks: 48
Thanked 172 Times in 134 Posts
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
Latest Blog: Very random blog entries (based on time)
Rep Power: 13
cosmeo3000 will become famous soon enoughcosmeo3000 will become famous soon enough
Points: 6,002.26
Bank: 89,660.72
Total Points: 95,662.98
Black - cosmeo3000 
Send a message via MSN to cosmeo3000
That's how I learned vb.net from vb6. Just looked at the initializing codes and used those.

But it's all managed which seriously if you want to use managed, go C#
__________________

Dam my other one won't animate for some reason o_O
  #5  
Old 08-27-2008, 03:13 AM
ItsGreg's Avatar
<span style="color: red;">&lt;span style=&quot;color: red;&quot;&gt;Mustache Mucho&lt;/span&gt;</span>
 
Last Online: Today 12:35 PM
Join Date: Sep 2007
Location: 46°21′50.14″N, 15°3′28.69″E
Age: 14
Posts: 1,385
Blog Entries: 5
Thanks: 123
Thanked 397 Times in 150 Posts
Nominated 8 Times in 6 Posts
TOTW/F/M Award(s): 0
Latest Blog: My info
Rep Power: 7
ItsGreg is on a distinguished road
Points: 10,365.10
Bank: 510,492.30
Total Points: 520,857.40
Send a message via MSN to ItsGreg
what's the diference between VB and C#?
__________________
  #6  
Old 08-27-2008, 04:05 AM
1k Points Wasted
 
Last Online: Yesterday 02:08 PM
Join Date: Aug 2006
Location: over there
Posts: 2,219
Blog Entries: 6
Thanks: 48
Thanked 172 Times in 134 Posts
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
Latest Blog: Very random blog entries (based on time)
Rep Power: 13
cosmeo3000 will become famous soon enoughcosmeo3000 will become famous soon enough
Points: 6,002.26
Bank: 89,660.72
Total Points: 95,662.98
Black - cosmeo3000 
Send a message via MSN to cosmeo3000
C# has more of the C++ syntax when vb is like a different language.

Ex.
Vb: Dim Number1 As Long
C#: int Number1;
__________________

Dam my other one won't animate for some reason o_O
  #7  
Old 08-27-2008, 04:23 PM
binny's Avatar
Team Leader
 
Last Online: 12-02-2008 06:57 PM
Join Date: Sep 2006
Location: Y do u wana kno huh ?
Posts: 1,225
Thanks: 255
Thanked 342 Times in 110 Posts
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
Latest Blog:
Rep Power: 9
binny will become famous soon enough
Points: 897.71
Bank: 21,487.80
Total Points: 22,385.51
A burger for Mr.Binny! - Yondaime 
Black - binny Brown - binny Burgundy - binny Dark Blue - binny Gold - binny 
Gray - binny Green - binny Lavender - binny 
Send a message via AIM to binny Send a message via MSN to binny
I believe C++ is alot easier than VB, but that's just me. You guys might have different opinions
__________________
Become Premium + And Get Access To Alot More!


Respectfull-[+Sonic25][_BBallRStud5_]-[+DaRkMaSTerz]-[+Vandrick]-[Mysterio]-[Hornstar6969]-[+mat789-]-[Kohakuslayer]-
[Wolfy]-[BleachNaruto]-[Demonite]-[Ken]-[Joriannn]
  #8  
Old 08-27-2008, 05:23 PM
LilCrazed's Avatar
Registered Users +
 
Join Date: Aug 2006
Location: California-BayArea-YayArea
Posts: 1,812
Thanks: 124
Thanked 459 Times in 176 Posts
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
Latest Blog:
Rep Power: 11
LilCrazed is on a distinguished road
Points: 1,313.10
Bank: 171,559.59
Total Points: 172,872.69
I Need This JP - BiGbAnG Get Drunk N Crunk - BiGbAnG Banana is good 4 u =D - BiGbAnG In N Out Burger is the best burger is good 4 u eat the grease fat burger =P - BiGbAnG For the Teachers Out There ^^ - BiGbAnG 
for bein gangster - Fonzi For Being G-Sta N living in the bayarea 916 n be so tight - SouljaGirl Did I say you can Have this? I'll Need it back later! - kaswar No Message - LilCrazed 
Black - BiGbAnG Brown - BiGbAnG Burgundy - BiGbAnG Dark Blue - BiGbAnG Gold - BiGbAnG 
Gray - BiGbAnG Green - BiGbAnG Lavender - BiGbAnG Green - LilCrazed Green - LilCrazed 
Green - LilCrazed 
Send a message via AIM to LilCrazed Send a message via MSN to LilCrazed Send a message via Skype™ to LilCrazed
nice tut but vb seems hard lol
__________________

  #9  
Old 08-27-2008, 06:14 PM
1k Points Wasted
 
Last Online: Yesterday 02:08 PM
Join Date: Aug 2006
Location: over there
Posts: 2,219
Blog Entries: 6
Thanks: 48
Thanked 172 Times in 134 Posts
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
Latest Blog: Very random blog entries (based on time)
Rep Power: 13
cosmeo3000 will become famous soon enoughcosmeo3000 will become famous soon enough
Points: 6,002.26
Bank: 89,660.72
Total Points: 95,662.98
Black - cosmeo3000 
Send a message via MSN to cosmeo3000
IMO Vb was easier for me, maybe because I had a hard copy of a vb book when my C++ stuff was all online...
__________________

Dam my other one won't animate for some reason o_O
  #10  
Old 08-27-2008, 08:57 PM
kaswar's Avatar
Registered Users +
 
Last Online: Today 12:03 PM
Join Date: Nov 2006
Location: Location:
Posts: 2,064
Thanks: 230
Thanked 221 Times in 145 Posts
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
Latest Blog:
Rep Power: 11
kaswar will become famous soon enough
Points: 1,091.40
Bank: 110,398.61
Total Points: 111,490.01
Here ya go. Don't get drunk! O.O - joriannn Marked as kashin's property. (One of the four Mighty Titans led by sir SpaceCake) - kashin Merry christmas and seriously i couldnt find any other gift - ItsmYarD Merry Christmas N Happy New Years!!! - BiGbAnG to karwas. Bang - stormer320 
gotcha RPKMHFTAGUITALABPC - ROVE ure not drunk enough yet - swordmas754 
Gold - Wizxon Green - swordmas754 Green - swordmas754 
Send a message via MSN to kaswar
IMO, Delphi is Easier than VB.

Reading VB coding is like me reading a different languaged Paragraph which soon sends me into a dark whirl pool of crashing light-speed fatalities.
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump