Thread: Copying info from multiple sources

  1. #1
    Registered User
    Join Date
    Jan 2002
    Posts
    31

    Copying info from multiple sources

    In my program I want the user to select three (3) different items from a drop down list. I then want it to show up in a read-only Rich Edit window. The three lists would be as follows: Provider, Attempt or Success, and Procedure. What I want to happen is when they select each one individually, it reads in the rich edit window as
    Code:
    Provider 1 attempted an Endotracheal tube.
    or
    Code:
    Provider 1 successfuly placed a Nasotracheal tube.
    . If something happens that more than one is selected, I want it to be able to add it as this:
    Code:
    Provider 1 successfully placed the nasogastric tube.
    Provider 2 attempted to defibrilate.
    Provider 1 attempted Needle Decompression Thoracostamy.
    . Each time the user completed picking their choices it would read it and move to the next line. If the user had to edit a slection, they would have to start all over again by clearing the rich edit box. Could you please help me figure this out.

    ~Brett Patterson

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Hmm....and what progress have you made so far.....looks a little too much like homework for my liking......

    If you have a specific query with the code you are using, then by all means post.......but if you want the program written I suggest Rentacoder......

  3. #3
    Registered User
    Join Date
    Jan 2002
    Posts
    31
    That is not even half of the program. Im not asking you to write it. All I need to know is once I have variables for the dropdown selection menus, how can I write them to the Rich Edit control box without erasing what has already been put in from previous entries. Adding text, not replacing it. Here goes: I have 3 dropdown menus. When all 3 have been selected, I will have them push a button and it will add the first line to the Rich Edit Text box. That I can do. How do I ADD lines underneath, specifically, how can I add lines like this [not exact words]:
    Code:
    I'm worthless,
    cause no-one likes to help me.
    Thanks for your help.

  4. #4
    Registered User sean345's Avatar
    Join Date
    Mar 2002
    Posts
    346
    What you can do is read what you already have in the rich edit and then combine the two strings in a new string and then print it over what is already in the rich edit.

    - Sean
    If cities were built like software is built, the first woodpecker to come along would level civilization.
    Black Frog Studios

  5. #5
    Registered User
    Join Date
    Jan 2002
    Posts
    31
    What I have done has created an array called circ[3]. This array will hold all 3 values of the end product. The 3 spots are for 1)Provider 2)Attempt and 3)What. I have this so far:
    Code:
    circ[0]=m_strProvider;
    circ[1]=m_strAttempt;
    circ[2]=m_strWhat;
    m_strCirculation=circ[3];
    UpdateData(FALSE);
    I have initialized the strings, but can't figure out how to convert from string to something that the array can hold. I read the tutorial but that was no help. Please help me.

    The actual error code is this:
    Code:
    error C2679: binary '=' : no operator defined which takes a right-hand 
         operand of type 'class CString' (or there is no acceptable conversion)
    Last edited by Prog.Patterson; 04-29-2002 at 10:36 AM.
    "Some succeed because they are destined to, others succeed because they are determined to."
    ~Anonymous

    "A shorn scrotum is quite breathtaking, I suggest you try it."
    ~Dr. Evil

    EMT/Firefighter
    Eagle Scout

  6. #6
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    Create the string you want to add.

    Read your RichText into another string.

    Concatinate the two strings with the + operator.

    Write the result back into your RichTextControl.


    If you have trouble with a step, post your code.
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Can't use multiple sources
    By OnionKnight in forum C Programming
    Replies: 3
    Last Post: 12-31-2005, 02:29 PM
  2. File resuming, and multiple sources
    By kronixx in forum C Programming
    Replies: 3
    Last Post: 04-13-2005, 04:20 PM
  3. Help doing an e-mail program in c...
    By Tyler_Durden in forum C Programming
    Replies: 88
    Last Post: 01-02-2005, 03:12 PM
  4. info on a program copying itself
    By linucksrox in forum C Programming
    Replies: 6
    Last Post: 05-16-2004, 12:41 PM
  5. copying to multiple destination
    By Unregistered in forum Linux Programming
    Replies: 1
    Last Post: 08-06-2002, 02:51 PM