Solved

User Interface

Posted on 1998-08-13
1
162 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
Comment Utility
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now