Need guidance ...
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9

Thread: Need guidance ...

  1. #1
    Join Date
    Jan 2012
    Location
    India
    Posts
    135

    Need guidance ...

    Hi ,

    I need to edit ,update and display a group of 40 parameters on screen .( 10 parameters per page and use of Arrow Key pad or touch screen clicks to modify value)

    For that I will need .. Parameter No . , String Name , Point Screen Cord , double value , next element no. etc
    I have my old code with structure and array of structure written in C. I have translated it on C++/MFC . But I am not happy.

    But pl suggest me some good method for c++ / MFC platform.

    How can I implement Class property of c++ ?

    pl Guide

  2. #2
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Posts
    12,047

    Re: Need guidance ...

    Your question si kind of vague as we don't know what you've done and what you need. Sounds like a typical MFC CDialog based app, or perhaps CPropertyPage and CPropertySheets to give you multiple pages.

    No idea what you mean by the Class property of C++

  3. #3
    Join Date
    Jan 2012
    Location
    India
    Posts
    135

    Re: Need guidance ...

    Sir , I need to display / edit / update a list of parameters. I have divided the screen into signal display area and parameter area. There is a dialog box to edit all system parameters . But Major Parameters can be edited by mouse click ( or touch screen). So I have listed them on Right Side of the display.

    I am using a structure

    Code:
    typedef struct {
         CString Name ;
         CString UnitName;
         CPoint DispCord;
         CString ValueInString;
         double Value;
         int Index ;
         int NextParamIndex;
         int PrevParamIndex;
    } ImpParam;
    I am considering Key Events and Mouse Events.

    All this works well.

    But I feel , I am using C and not C++.

    So pl guide me .. How all this can be in C++.? How can I define a class for all this ? Are there any better features to implement all this.?

    pl guide ..

  4. #4
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    5,923

    Re: Need guidance ...

    Quote Originally Posted by new_2012 View Post
    All this works well.

    But I feel , I am using C and not C++.
    You feel wrong. As long as you use CString and CPoint, you use C++. Besides, there's nothing wrong in using structures in C++. You'd better feel you have no idea what is using pure C.
    Best regards,
    Igor

  5. #5
    Join Date
    Jan 2012
    Location
    India
    Posts
    135

    Re: Need guidance ...

    Thank you sir .. Now I am feeling happy. I felt that I should design a class . But then there are 40 parameters ..so 40 objects ???
    I was confused. With structures the code was simple to write . Thank you again.

  6. #6
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Posts
    12,047

    Re: Need guidance ...

    Quote Originally Posted by new_2012 View Post
    Thank you sir .. Now I am feeling happy. I felt that I should design a class . But then there are 40 parameters ..so 40 objects ???
    I was confused. With structures the code was simple to write . Thank you again.
    In C++, a struct and a class are for all intents and purposes, the same thing. If you want to use a class, it would likely have 40 members, some of which may be objects.

  7. #7
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,196

    Re: Need guidance ...

    What do you have in mind in terms of layout of the screen? I ask because if you display with some reusability in mind, it might alter how you store the data on the backend.

  8. #8
    Join Date
    Jan 2012
    Location
    India
    Posts
    135

    Re: Need guidance ...

    Sir , I have divided my screen into 2 parts .. 3/4 th for the display .. where all graphics and signals are shown . In 1/4th area , I am drawing rectangular shaded bitmaps , with parameter name ( for e.g. Frequency ,Phase ,Volume gain etc) and its values and units. I can edit them with Arrow Key Pad or Mouse Clicks. I am also scrolling the parameters . After editing the parameter I need to run a function to send the value to system. I am using Function Array for this.

    This I had implemented in DOS DPMI mode and now I am using the same structures and arrays. I will need to convert the same project on C# platform after 6 months . I think with Form , I can use bit-mapped Edit Boxes , Split Screen etc

    So thinking on some good new algorithm.

  9. #9
    Join Date
    Jan 2012
    Location
    India
    Posts
    135

    Re: Need guidance ...

    GCDEF sir I was thinking on your suggestion yesterday

    Yes I will write down algorithms on paper ..

    1. Class with 40 members .. Protected varibles and common
    display and execute function.

    and

    2. Class with virtual functions and 40 objects .. so each will display/modify/execute self.

    Then I will study which seems to be better ..

    I think I can use common Execute Parameter Function for dialog box and touch screen

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center