Go to Post Remind me again. Why do we let the GDC hold us captive to these hints year after year? - jholman [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 11-07-2010, 10:20 PM
kgzak's Avatar
kgzak kgzak is offline
Registered User
AKA: Kris
FRC #4392 (Decievers) FRC #2075 (Enigma)
Team Role: College Student
 
Join Date: Dec 2008
Rookie Year: 2008
Location: Grand Rapids, Michigan
Posts: 418
kgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to behold
C++ Windows Form Application Help

I am working in C++ to make a program that will keep track of our hours at robotics. The idea is that you would pick you name from a list and click sign in and it would store the time you clicked and then when you left you would click sign out and it would calculate the time you had been there. I was planning on using an array to store the beginning time and another one to store the ending. I do not have that much experience in C++ (took a class last year at our high school) and have absolutely no experience in C++ form applications. I kinda know how to do this in Visual Basic but I thought C++ would be a fun challenge. How would I go about making a global array to use in my functions? I read that I would have to put it in a header file but how would I go about doing that? All help will be appreciated.

edit: I am using Visual Studio 2008. I don't know if that matters at all.

Last edited by kgzak : 11-07-2010 at 10:26 PM. Reason: more info
  #2   Spotlight this post!  
Unread 11-07-2010, 10:54 PM
jee7s jee7s is offline
Texan FIRSTer, ex-frc2789, ex-frc41
AKA: Jeffrey Erickson
FRC #6357
 
Join Date: Nov 2007
Rookie Year: 1997
Location: Dripping Springs, TX
Posts: 298
jee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond repute
Re: C++ Windows Form Application Help

My short answer would be to use C#. It uses C++ syntax and gives you quicker access to the form classes that you'll want to use.

If you are positively set on using C++, then I'd get well read on MFC (yuck!) or the CLR extensions in C++ including how to write "managed code" in C++. Again, these are fairly substantial headaches that you can bypass by using C#.

Regarding your specific question about global arrays, they are generally a bad practice in C++. Also, if you don't know just how many elements there will be, you'll want to use a dynamic allocation type, like Vector (found in the STL header 'vector.h'). You may want to consider having a class (with the appropriate access functions) to hold the arrays/vectors. Or have a class to describe a person who's time you are tracking, then hold the time values there.

As a side question, have you considered how you're going to persist the data? I assume you want to be robust against a program crash or power outage.
__________________

2013 Alamo Regional Woodie Flowers Finalist Award Winner
2012 Texas Robot Roundup Volunteer of the Year
Texas Robot Roundup Planning Committee, 2012-present
FRC 6357 Mentor, 2016-
FRC 2789 Mentor, 2009-2016 -- 2 Golds, 2 Silvers, 8 Regional Elimination Appearances

FRC 41 Mentor 2007-2009
FLL Mentor 2006
FRC 619 Mentor 2002
FRC 41 Student 1998-2000
  #3   Spotlight this post!  
Unread 11-07-2010, 11:20 PM
kgzak's Avatar
kgzak kgzak is offline
Registered User
AKA: Kris
FRC #4392 (Decievers) FRC #2075 (Enigma)
Team Role: College Student
 
Join Date: Dec 2008
Rookie Year: 2008
Location: Grand Rapids, Michigan
Posts: 418
kgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to behold
Re: C++ Windows Form Application Help

I guess I'll try C# there is no particular reason that I am using C++ except to learn. I guess learning C# would be just as much of a learning C++. I really don't know what I am doing to persist the data. never done anything like that before. if you have any advice, that'd be great.
  #4   Spotlight this post!  
Unread 11-08-2010, 12:06 AM
Fletch1373's Avatar
Fletch1373 Fletch1373 is offline
Registered User
AKA: Fletch
FRC #3181 (Panthers)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2004
Location: Rochester, NY
Posts: 247
Fletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud of
Re: C++ Windows Form Application Help

at first thought, options could include a database(VS2008 has the ability to create a SQL server database file and automatically set up the code to connect to it) or a flat text file. I am a fan of redundancy when it seems useful(as with the power outage case), so I would suggest the database for generic storage, and a flat text file as a log(possibly in a CSV or XML format)


It may seem excessive to some people but I'm fine with that haha
__________________
Student:
<04: FRC0213> <05-08: FRC1373>
Mentor:
<09-10: FRC0809> <11-12: FRC3555> <12-14: FRC0073> <15-??: FRC3181>
Volunteer:
<FTAA> <CSA> <Defense Coordinator> <Scorekeeper> <Robot Inspector> <Official Scorer>
2016 Tour:
CTWAT [DefCoord] > Pittsburgh[Mentor/DefCoord] > TVR[FTAA] > FLR[CSA] > NE DCMP[CSA] > CMP[CSA]
  #5   Spotlight this post!  
Unread 11-08-2010, 09:34 PM
GGCO's Avatar
GGCO GGCO is offline
Registered User
AKA: Grant
FRC #3357
Team Role: Alumni
 
Join Date: Jan 2008
Rookie Year: 2004
Location: Michigan
Posts: 406
GGCO is a splendid one to beholdGGCO is a splendid one to beholdGGCO is a splendid one to beholdGGCO is a splendid one to beholdGGCO is a splendid one to beholdGGCO is a splendid one to beholdGGCO is a splendid one to beholdGGCO is a splendid one to behold
Send a message via AIM to GGCO
Re: C++ Windows Form Application Help

Yeah, I second using C#. If you don't have enough experience writing this thing, why don't you try VS Lightswitch. It's kind of like MS Access on steroids, and sounds like it might solve your problem well.
__________________
"Great spirits have always encountered violent opposition from mediocre minds" - Albert Einstein
The FIRST Alliance
COMETS Robotics
Website

  #6   Spotlight this post!  
Unread 11-08-2010, 09:38 PM
Slix Slix is offline
Registered User
AKA: Peter Kowalczyk
FRC #2115 (NightMares)
Team Role: Programmer
 
Join Date: Mar 2010
Rookie Year: 2010
Location: Mundelein, IL
Posts: 31
Slix is an unknown quantity at this point
Re: C++ Windows Form Application Help

If you want to use C++, you could use a GUI library/framework like Qt or wxWidgets. These are probably much better than the mentioned Microsoft solutions, though they probably have a learning curve as well.

Python has some gui libraries as well, including python bindings for Qt and wxWidgets.

I don't know enough about C# to suggest whether that is a better solution.
  #7   Spotlight this post!  
Unread 11-08-2010, 09:49 PM
kgzak's Avatar
kgzak kgzak is offline
Registered User
AKA: Kris
FRC #4392 (Decievers) FRC #2075 (Enigma)
Team Role: College Student
 
Join Date: Dec 2008
Rookie Year: 2008
Location: Grand Rapids, Michigan
Posts: 418
kgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to behold
Re: C++ Windows Form Application Help

I switched to C# and it made things much simpler. I have decided to use a database to store everything and a class to keep track of all the variables. I'll look up VS lightswitch and see what I can do with that. I was thinking python but I honestly have little to no experience with it so I'll save that for a simpler program.
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
Team 2230 Windows Scouting Application - Beta testing needed Bomberofdoom Scouting 6 03-04-2009 05:27 AM
need help for ie application kim.ray Programming 1 09-05-2008 09:56 AM
Help Getting rid of Spyware/Windows XP help George A. Chit-Chat 9 02-17-2007 02:35 PM
Grant application help needed Rickertsen2 Fundraising 3 08-24-2005 10:26 AM
Program to copy list of files from Windows explorer as text into an application? Elgin Clock IT / Communications 6 12-30-2004 09:23 PM


All times are GMT -5. The time now is 07:11 AM.

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