Go to Post Students dream up the ideas for bots, it is than up to the mentors and engineers to make these dreams a reality. - dddriveman [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 02-01-2003, 21:25
Hailfire Hailfire is offline
Registered User
AKA: Jason
no team
Team Role: College Student
 
Join Date: Oct 2002
Rookie Year: 2003
Location: Rochester, Michigan
Posts: 452
Hailfire has a little shameless behaviour in the past
Send a message via AIM to Hailfire
Need Help With Windows Applications In C++

For all of you programmers out there familiar with C++, how would you program a button to open a new window in a dialog based executible file?
  #2   Spotlight this post!  
Unread 02-01-2003, 21:29
rbayer's Avatar Unsung FIRST Hero
rbayer rbayer is offline
Blood, Sweat, and Code
no team (Teamless Orphan)
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Minnetonka, MN
Posts: 1,087
rbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of light
Send a message via AIM to rbayer
I'm a little confused by what you're trying to do. Are you using MFC or the straight Windows API? Do you have the button/main window code done and you're just trying to open a second window? Finally, what do you want to have appear in this new window?

Anyway, either reply here or email me and I'll hook you up with some code snippets for any/all of these cases (I have a lot laying around from RoboGUI and RoboEmu).
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php
  #3   Spotlight this post!  
Unread 02-01-2003, 21:33
Hailfire Hailfire is offline
Registered User
AKA: Jason
no team
Team Role: College Student
 
Join Date: Oct 2002
Rookie Year: 2003
Location: Rochester, Michigan
Posts: 452
Hailfire has a little shameless behaviour in the past
Send a message via AIM to Hailfire
First of all, I'm using MFC and second of all, I want the button displaying "Search" to open a new window and search for a specific file in a database. So far, I have about half of the project done. All of the windows are made, and all the buttons, etc. are in place. All I have to do is program the buttons to open new windows, save files, load files, search for files using specific keywords, and import pictures.

Last edited by Hailfire : 02-01-2003 at 21:40.
  #4   Spotlight this post!  
Unread 02-01-2003, 21:44
rbayer's Avatar Unsung FIRST Hero
rbayer rbayer is offline
Blood, Sweat, and Code
no team (Teamless Orphan)
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Minnetonka, MN
Posts: 1,087
rbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of light
Send a message via AIM to rbayer
In that case, just create a message handler for the button using Class Wizard. Assuming you decide to call it something like OnSearchButton and your class for your search dialog is called CSearchDlg, the function would look something like this:

Code:
void CYourMainWndClass::OnSearchButton(){
  CSearchDlg searchDlg;
  int ret;

  
  ret=searchDlg.DoModal();

  if(ret==-1 || IDABORT)
    //error occurred
  else
    //ret contains value passed to EndDialog.  Process accordingly


}
That's the basics. If you're looking for something more advanced, email me.
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php
  #5   Spotlight this post!  
Unread 02-01-2003, 21:46
Hailfire Hailfire is offline
Registered User
AKA: Jason
no team
Team Role: College Student
 
Join Date: Oct 2002
Rookie Year: 2003
Location: Rochester, Michigan
Posts: 452
Hailfire has a little shameless behaviour in the past
Send a message via AIM to Hailfire
Uh, where exactly in the code would you put this? I'm actually more familiar with DOS based and I wanted to learn Windows based.
  #6   Spotlight this post!  
Unread 02-01-2003, 21:53
Jnadke Jnadke is offline
Go Badgers!
#0093
Team Role: Alumni
 
Join Date: Jan 2002
Location: Appleton, WI
Posts: 775
Jnadke is on a distinguished road
Send a message via ICQ to Jnadke Send a message via AIM to Jnadke Send a message via Yahoo to Jnadke
Try this book.

Programming Windows by Charles Petzold

I know you may not want to read books, but it's the best Windows programming book you can buy. It's probabaly the only one you really need.
__________________
The best moments of our lives fall in two categories: those that did happen and those that did not.
  #7   Spotlight this post!  
Unread 04-01-2003, 23:10
Raven_Writer's Avatar
Raven_Writer Raven_Writer is offline
2004 Detroit & Pittsburgh Winners
AKA: Eric Hansen
FRC #0005 (RoboCards)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2002
Location: Melvindale
Posts: 1,549
Raven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really nice
Send a message via ICQ to Raven_Writer Send a message via AIM to Raven_Writer Send a message via MSN to Raven_Writer Send a message via Yahoo to Raven_Writer
Actually, One by Andre LaMonth is pretty good (I think it's called "Tips By Window Guru's" or something like that (search for it over at GameDev.Net))
__________________
AIM: wisprmylastbreth
EMail: nightskywriter@gmail.com
Y!: synsoflife

"ai yoru ga" -- "Love the nights"
  #8   Spotlight this post!  
Unread 05-01-2003, 01:35
Ryan Meador Ryan Meador is offline
Registered User
#0190
Team Role: Electrical
 
Join Date: Jan 2002
Rookie Year: 1999
Location: Worcester, NH
Posts: 68
Ryan Meador will become famous soon enough
Beware of Lamothe books... they're good to learn by, but the rule of thumb is never, ever use the style of coding he does. 99% of the time it's considered just plain bad form and nastily inefficient. Still, I learned DirectX through one of his books, and after hanging around some real programmers to straighten out my misuse of some stuff, it worked real well More on-topic, if you're using MSVC++ 6, I belive double-clicking the search button in the resource editor while holding CTRL will bring up the place you need to put the aforementioned code. You'll need to make a class for your search dialog, and the same procedure (or at least a similar one; I'm doing this from memory) will create that class from the resource. Good luck and happy coding.

PS - Gamedev.net rules, and you really need to check out the chat. It'll solve all your programming woes.
  #9   Spotlight this post!  
Unread 05-01-2003, 01:37
rbayer's Avatar Unsung FIRST Hero
rbayer rbayer is offline
Blood, Sweat, and Code
no team (Teamless Orphan)
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Minnetonka, MN
Posts: 1,087
rbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of light
Send a message via AIM to rbayer
Yeah, just ditch the CTRL key--you don't need it.
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php
  #10   Spotlight this post!  
Unread 05-01-2003, 10:13
Raven_Writer's Avatar
Raven_Writer Raven_Writer is offline
2004 Detroit & Pittsburgh Winners
AKA: Eric Hansen
FRC #0005 (RoboCards)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2002
Location: Melvindale
Posts: 1,549
Raven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really nice
Send a message via ICQ to Raven_Writer Send a message via AIM to Raven_Writer Send a message via MSN to Raven_Writer Send a message via Yahoo to Raven_Writer
GameDev is alright, but they still need to update their articles more. But more topic, this actually might depend on your compiler. Because MSVC++ .NET is different than MSVC++ 6 (or below). I'm not exact on this statement, but I've seen it, and read reviews about how MSV* .NET is different than MSV* (where the stars stand for like 'B' for Visual Basic)...plus, MSVC++ .NET seems more like VB 6 for the fact that you have drag-and-drops (unless I was looking at a wrong box)
__________________
AIM: wisprmylastbreth
EMail: nightskywriter@gmail.com
Y!: synsoflife

"ai yoru ga" -- "Love the nights"
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux And Windows XP Raven_Writer Chit-Chat 4 06-08-2003 18:53
Windows ME robot180 Chit-Chat 11 07-07-2003 00:21
Windows XP Partition is Odd Yan Wang Chit-Chat 6 05-07-2003 23:30
Home Networking on Windows XP D.J. Fluck Chit-Chat 16 14-09-2002 14:21
MAC vs. PC! LET'S GET IT ON! MattK Chit-Chat 99 31-07-2002 21:06


All times are GMT -5. The time now is 09:03.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi