Results 1 to 2 of 2

Thread: Reading text file in VC++ display it in textbox

  1. #1
    Join Date
    Jul 2010
    Posts
    1

    Reading text file in VC++ display it in textbox

    Hello every one,

    I am new in C++ and I have a new project.
    I have a text file with numbers that are coordinates x,y

    The text files´s format looks like this:

    X Y

    234 5678
    243 3456
    193 235
    1234 345

    and so on

    Steps,

    1.- Put all this file in a buffer memory (unsigned char inbuffer [2000],
    2.- Display each two coordinates in two text box one for X and one for Y (I dont´t know how to do this)
    3.- inbuffer [0] = outbuffer[0]
    inbuffer [1] = outbuffer[1]

    4.-increment inbuffer + 2 for next two coordinates
    5.-Put this data in USB (Resolved)
    6.-Microcontroller sends ready bit to receive more data (resolved)
    7.-Repeat from step 2 until all data is sended.
    I really appreciate your help with a little code.

    Regards
    Carlos

  2. #2
    Join Date
    Dec 2007
    Posts
    2,291

    Re: Reading text file in VC++ display it in textbox

    Can you please tell us that do you know the ID of each text box? And you have the HWND of the dialog box that contains the edit controls, right? Then use GetWindowText() for each box.

    Code:
    char text[255]; // or however long the strings are
    // hWnd is the HWND of the dialog box
    HWND hEditWnd = GetDlgItem(hWnd,IDC_EDIT1);
    // get 1st text box
    GetWindowText(hEditWnd, text);

Similar Threads

  1. Reading a text file divided by tab
    By Cooper Sheldon in forum Software Development
    Replies: 4
    Last Post: 08-09-2012, 04:08 PM
  2. Replies: 2
    Last Post: 20-08-2010, 01:23 AM
  3. Problem of textbox that does not display text
    By RyanInt in forum Software Development
    Replies: 4
    Last Post: 11-12-2009, 05:55 PM
  4. Reading from INI file to several textbox in VB.NET
    By MABON in forum Software Development
    Replies: 5
    Last Post: 04-11-2009, 09:23 PM
  5. Reading text string from text file (PHP)
    By Moderate in forum Software Development
    Replies: 3
    Last Post: 16-01-2009, 03:27 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,933,889.59875 seconds with 17 queries