Google Answers Logo
View Question
 
Q: MSVC++ 6.0 help ( No Answer,   3 Comments )
Question  
Subject: MSVC++ 6.0 help
Category: Computers > Programming
Asked by: chris2002micrometer-ga
List Price: $20.00
Posted: 27 Nov 2002 18:00 PST
Expires: 27 Dec 2002 18:00 PST
Question ID: 115753
I want to write a simple interactive GUI that requires the user to
select an input file/directory and enter some new data in a form to
add to the
file and present some calculated results on the screen. I have done
this kind of thing in Visual Basic with no problem, but the C++ leaves
me cold. What choices do I need to make with the app wizard? Where is
the file selector object that seems to be missing? Is opening and
reading a flat file with csv a big deal? Do you have a suitable
example? Books seem to have too many simple "hello programs" or huge
OOD internet apps that won't ever work with my ISP. I need
straightforward advice and/or a working example that will enable me to
do this.

Request for Question Clarification by mathtalk-ga on 22 Dec 2002 20:52 PST
Hi, chris2002micrometer:

I wonder if you are still interested in a simple working example along
the lines described... file dialog to open a .CSV file to populate a
form/table that allows editing and/or creation of new records.

If so, it would help to understand your background a little better, so
that I don't charge off in all directions.  Given that you are
familiar with VB ways to do these things, I would think it fair to
assume a working knowledge of COM components (ActiveX stuff).

What I would suspect, though, is that even with this you face two
steep learning curves simultaneously.  One is the C++ language per se,
and the other is the Microsoft "philosophy" of reusing COM components
in C++.  In addition to the MFC library approach mentioned by
jeanlouis-ga, there is a "newer" approach in VC++ 6.0 that is referred
to as ATL.

So as far as doing these smallish GUI apps in VC++ 6.0, I think you
will likely have to contend with the C++ language and the ATL wizard
framework.  I can put together an example, but before I do, I thought
it best to check to see if you are still interested (so much time
having passed since your original post).

regards, mathtalk-ga

Clarification of Question by chris2002micrometer-ga on 23 Dec 2002 10:14 PST
Dear mathtalk-ga 

I am currently working with a file that looks like this (you may have
unwrap the lines):

TEST20021222221542,01,238,32107,00145,02,003,40524,00054,03,003,28709,00114,04,027,06966,00244,05,000,31818,00031,06,000,05069,00245,07,000,37617,00070,08,010,49056,00132,09,008,59209,00668,10,000,47148,00667,11,000,15074,00000,12,000,00132,00000,13,000,00170,00000,14,000,00234,00000,15,170,38231,00500,16,000,00139,00000,
TEST20021222221821,01,000,32107,00145,02,000,40524,00054,03,003,28712,00114,04,024,06990,00244,05,000,31818,00031,06,000,05069,00245,07,000,37617,00070,08,010,49066,00132,09,008,59217,00668,10,000,47148,00667,11,000,15074,00000,12,000,00132,00000,13,000,00170,00000,14,000,00234,00000,15,013,38244,00500,16,000,00139,00000,
TEST20021222222239,01,000,32107,00145,02,000,40524,00054,03,003,28715,00114,04,025,07015,00244,05,000,31818,00031,06,000,05069,00245,07,000,37617,00070,08,010,49086,00132,09,000,59217,00668,10,000,47148,00667,11,000,15074,00000,12,000,00132,00000,13,000,00170,00000,14,000,00234,00000,15,015,38272,00500,16,000,00139,00000,
TEST20021222225626,01,238,33301,00145,02,003,40536,00054,03,003,28754,00114,04,025,07364,00244,05,000,31818,00031,06,000,05069,00245,07,000,37617,00070,08,009,49212,00132,09,008,59265,00668,10,000,47148,00667,11,000,15074,00000,12,000,00132,00000,13,000,00170,00000,14,000,00234,00000,15,170,39221,00500,16,000,00139,00000,
TEST20021222225905,01,006,33307,00145,02,000,40536,00054,03,004,28758,00114,04,024,07388,00244,05,000,31818,00031,06,000,05069,00245,07,000,37617,00070,08,009,49221,00132,09,000,59265,00668,10,000,47148,00667,11,000,15074,00000,12,000,00132,00000,13,000,00170,00000,14,000,00234,00000,15,170,39391,00500,16,000,00139,00000,
TEST20021222232246,01,000,34027,00145,02,010,40552,00054,03,003,28794,00114,04,024,07618,00244,05,000,31818,00031,06,000,05069,00245,07,000,37617,00070,08,009,49306,00132,09,000,59289,00668,10,000,47148,00667,11,000,15074,00000,12,000,00132,00000,13,000,00170,00000,14,000,00234,00000,15,013,39988,00500,16,000,00139,00000,
obs date    time   id inst Lcum  Hcum, 15 more like this

I have a long background in computers since early 70's and understand
many fundamental
concepts, that often seem (these days) to be "renamed, repackaged and
re-sold". The MS terminology
is difficult, like when you say COM (oh,yeah 8-bit no parity). I don't
know if I have used "active x"
unless it was some little object that I dragged onto a
form, sorta like i use tcpip all the time (whenever I surf the web). I
want to use the most
professional tools I can to develop with, and can generally learn from
working examples of code.
I tend to prefer code that contains the minumum statements (that I
must type, anyway) to do the job
with simple, short names that are clearly not reserved words so I can
tell what's mine and what's necessary in the
environment. 

The above file comes from instrumentation that appends new lines at
the bottom. I would like to be able to read it into
storage (or pass it once) and select any 2 lines for further
processing. Once selected, the earlier (date,time) line should be
compared to the later one to ensure the 1st 4 bytes match, the second
date/time is not the same (or earlier). Then
format a new line the same way with the integer average of "inst" and
the (positive) differences of Lcum and Hcum (for all 16 chennels).
Just use the second date,
same id's, etc. Show the two lines and the resulting line on the
screen. Prompt for an "ok" and write (append) the derived line to a
new file.

There is certainly more to this app, but the above would get me
started. The example will need a file/directory object to establish
the working directory.
Can you build this easily with VC++? What would the wizard choices be
to get to the best starting point?
Chris
Answer  
There is no answer at this time.

Comments  
Subject: Re: MSVC++ 6.0 help
From: jeanluis-ga on 27 Nov 2002 20:00 PST
 
There are a bunch of examples of MFC programs out there. 
I would start with code guru, they tend to have a ton of MFC info that
is usually pretty helpful.
http://www.codeguru.com

They even have a mfc tutorial
http://www.codeguru.com/cpp_mfc/Tutorial-1.shtml

As far as your specific questions, unfortunately I don't have the time
to address them in detail (hence I am posting this as a comment). But
it sounds like what you want to open the file is the CFileDialog box.
They are a strange beast, I advise searching for CFileDialog on
codeguru and MSDN after going through the tutorial.

MSDN:
http://msdn.microsoft.com
 
Opening and reading a CSV file should be very basic, there is nothing
special that needs to be done, once the user has selected the file
from the CFileDialog box, then you get the path and filename of that
file in a string, and you can use the standard I/O calls to open it,
read it, then close it (fopen(), fread(), fclose()). Then you can
parse the data however you want.

Once you figure out the MFC basics, it ain't so bad... Although there
are times when I find it can be very annoying and almost impossible to
get exactly what I want out of MFC... Anyhow sorry I couldn't be of
more help. If you have more questions (which I am sure you will)
please post them, and if I have more time later on I will get back to
you with more detail.
Thanks,
   ---jld
Subject: Re: MSVC++ 6.0 help
From: chris2002micrometer-ga on 29 Nov 2002 06:47 PST
 
jeanluis-ga - Thank you for the helpful leads. I would like to learn
to use this but I really need a good quick start example. VB is great
but VC++ seems to be a lot like "assembler coding".
Chris
Subject: Re: MSVC++ 6.0 help
From: joseleon-ga on 22 Dec 2002 23:44 PST
 
Hello:
  I supose MSVC++6.0 is a requeriment for you, but as I see you have
experience with Visual Basic I suggest you to use Borland C++ Builder,
it will save you a lot of time and C++ coding.

Regards.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy