Solved

User Interface

Posted on 1998-08-13
1
187 Views
Last Modified: 2013-11-20
I am currently writing a program in C++ to work out the optimal way to cut stock. I am reading the orders in from a datafile and attempting to print out the results to a printer.
I have not used visual C++ before and want to know how easy it will be to transfer the program to visual C++ and add a reasonably straightforward GUI with the following features:

1) Read in the values from a spreadsheet or grid type of format
2) Allow the user to save /load the values from/to disk
3) Send the results to a printer after being processed by my algorithm


I also have a pre written text class and list class which i want to use. Is it easy to integrate these into the visual C++ structure.
Would I use the wizard to add these features to my C++ program or do I need to put in special code myself.

I don't know if these are relatively straightforward problems or require alot of work?
0
Comment
Question by:Paul10
1 Comment
 
LVL 8

Accepted Solution

by:
Answers2000 earned 180 total points
ID: 1320740
My suggest is first of all to try a couple of practice apps on Visual C++ (e.g. some samples that came with the compiler or Prosise book samples).  Also buy objective grid from Stingray (this is a lot easier than writing it your self and doesn't cost much).

When you're ready to go for it :-
(a) Use the Class Wizard to generate a new App.  I would suggest you pick SDI as this is simplest.  Make your view class (it will be called something like CMyAppView) derive from CEditView.  
(b) Now add the stingray library to your project.  Change your view class to derive from their Grid View class instead of CEditView class to
(c) Now add the file reading and writing code.  This best goes inside the Serialize functions in the class which is derived from CDocument (which will be called something like CMyAppDoc)
(d) Alter the menu resources using the resource editor in dev-studio to have any changes you want.
(e) Add code to the View/Class using the class wizard (press Ctrl-W)
(f) For printing - put the code in OnDraw.  You can just sort of draw it out onto the printer (you give X,Y coords etc and can draw lines, text, etc.)

Your list class - if you mean it does linked lists etc. - you can probably just add it (but you should consider using MFC's CList class instead which is very good).  If you mean it does some special kind of list boxes you will have to change the code - derive from CWnd.

Your text class - same kind of things.  If it's a windowing class, derive it from CWnd or CEdit.

The easiest way to derive from CWnd/CEdit is to create a **new class** using class wizard, then cut & paste your existing code in.

0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question