944,176 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 26168
  • C++ RSS
Jul 16th, 2006
0

How to make windows form from c++ code (GUI)

Expand Post »
Hello everybody,
I'm totally newbie with c++ language.
I'm using Visual C++ 2005 Express Edition.
I like to make a working GUI with my first c++ code.
My question is:
How to insert this code to Windows Forms (GUI) that contain:
1. Press "Button" to randomly generate the number from the code
2. "TextBox" to display the result from generated number.

I hope someone will provide me the full code that i can compile it here.

Here is the code:

C++ Syntax (Toggle Plain Text)
  1.  
  2. #include <cstdlib>
  3. #include <ctime>
  4. #include <iostream>
  5. using std::cout;
  6. int main( ) {
  7. // srand will set a random starting point for rand()
  8. // We use the time as a seed, as it's always changing
  9. srand( ( unsigned )time( 0 ) );
  10. // We generate a random number between 0 and 4013
  11. // 4013 because ( 22423 * 4013 => 89983499 and
  12. // 89983499 + 10016486 => 99999985 - our max value )
  13. int randomKey = rand() % 4013;
  14. // Output the generated key and don't immediately close the command prompt window
  15. cout << "Your random key is: ABC" << ( 10016486 + ( randomKey * 22423 ) ) << "\n";
  16. system( "PAUSE" );
  17. return 0;
  18. }

Tahnks for any suggestion and help.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
L33VaNcL33F is offline Offline
1 posts
since Jul 2006
Jul 16th, 2006
0

Re: How to make windows form from c++ code (GUI)

Making GUIs in C++ is rather complicated. I suggest you try to download a tutorial about it. There are plenty of tutorials about GUI making out there.

If you're willing to pay http://www.experts-exchange.com/Prog..._21902809.html is pretty nice.


http://www.rohitab.com/discuss/lofiv...hp/t11408.html


Excuse me if I sound a bit rude, but next time please google before you post.


Greetz, Eddy
Reputation Points: 38
Solved Threads: 3
Junior Poster in Training
Eddy Dean is offline Offline
56 posts
since Jul 2006
Jul 17th, 2006
0

Re: How to make windows form from c++ code (GUI)

You can find two tutorials here and here
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2283
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,963 posts
since Aug 2005
Jul 21st, 2006
0

Re: How to make windows form from c++ code (GUI)

hi all

i've downloaded the generic source code from the first link provided by Ancient Dragon.

Sorry if this is really basic, and i dont know what to look up on google to answer my question, but what do i do with the files? I'm guessing i have to put them somewhere in Dev C++ program but i dont know where.

Any help would be great

cheers
Last edited by Simon268; Jul 21st, 2006 at 9:04 am.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Simon268 is offline Offline
7 posts
since Jul 2006
Jul 21st, 2006
0

Re: How to make windows form from c++ code (GUI)

Just getting the source code copied from any website is not much of an achievement, it would be better if you do a reality check and start learning C++ from ground up , from beginner to advanced and you will automatically figure out the answers to your questions.

Sorry if i have been rude but its best to have strong basics than just jumping in the fray not knowing wat the hell is going on.

Bye.
Super Moderator
Featured Poster
Reputation Points: 3241
Solved Threads: 719
Failure as a human
~s.o.s~ is offline Offline
8,873 posts
since Jun 2006
Jul 25th, 2006
0

Re: How to make windows form from c++ code (GUI)

Hi L33VaNcL33F,
Search for Win32 API tutorials.
This would help:
C++ Syntax (Toggle Plain Text)
  1. http://www.zeuscmd.com/

Good luck.
Reputation Points: 55
Solved Threads: 11
Junior Poster
mostafadotnet is offline Offline
157 posts
since Jul 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: function for merging two lists
Next Thread in C++ Forum Timeline: Someone who wants to learn C++ with me?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC