get field of the screen

This is a discussion on get field of the screen within the C++ Programming forums, part of the General Programming Boards category; hello friends. I have a new problem, I developer a project for smart device and have a text field on ...

  1. #1
    Registered User
    Join Date
    Mar 2009
    Posts
    3

    get field of the screen

    hello friends.
    I have a new problem, I developer a project for smart device
    and have a text field on the screen, his name is IDC_EDIT_LEN

    I would like to know how I get the information entered in this field tried in various ways but not works:
    Code:
    wsprintf(szLen , TEXT("%d"),(IDC_EDIT_LEN)); /*this field is number*/
    /*but put in the file ???? or 1001 when your value*/
    hctl_length = GetDlgItem(hwnd,IDC_EDIT_LEN);
    
    /*camara are variables of type LPTSTR to inform the field 5555 and return ??? ou return 1001(value):*/
    
    
    camara = (LPTSTR) (hctl_length, szLen); /* return 1001*/
    camara1 = (LPTSTR) (szLen); /* return 1001*/
    camara2 = (LPTSTR) hctl_length; /* return ????*/
    camara3 = (LPTSTR) GetDlgItem(hwnd,IDC_EDIT_LEN); /* return ????*/
    camara4 = (hctl_length, szLen); /* return 1001 */
    
    /*and nothing return 5555  that's what was briefed on the screen*/
    
    
    dados = (LPTSTR)SCNBUF_GETDATA(lpScanBuffer); /*this is correct*/
    ponto = (LPTSTR)";";
    
    lfp = fopen("transf.txt","a");
    if(lfp)
    {
    
    fwprintf(lfp,camara);
    fwprintf(lfp,ponto);
    fwprintf(lfp,camara1);
    fwprintf(lfp,ponto);
    fwprintf(lfp,camara2);
    fwprintf(lfp,ponto);
    fwprintf(lfp,camara3);
    fwprintf(lfp,ponto);
    fwprintf(lfp,camara4);
    fwprintf(lfp,ponto);
    fwprintf(lfp,dados);
    fwprintf(lfp,ponto);
    fclose(lfp);
    }
    Tanks for help

  2. #2
    Registered User
    Join Date
    Mar 2009
    Posts
    3
    No response friends??

  3. #3
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,269
    GetDlgItemInt or GetDlgItemText perhaps?
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

  4. #4
    Registered User
    Join Date
    Mar 2009
    Posts
    3
    with GetDlgItemInt :
    int teste;
    teste = GetDlgItemInt(hwnd,IDC_EDIT_LEN);

    this error:

    Error 1 error C2198: 'GetDlgItemInt' : too few arguments for call c:\Documents and Settings\lorenzi\Meus documentos\Visual Studio 2008\Projects\BasicScan\BasicScan.c 327 BasicScan

    with GetDlgItemText
    this error
    Error 1 error C2198: 'GetDlgItemTextW' : too few arguments for call c:\Documents and Settings\lorenzi\Meus documentos\Visual Studio 2008\Projects\BasicScan\BasicScan.c 328 BasicScan

    but if i use wsprintf(szBuffer, L"%o", GetDlgItemText(hwnd,IDC_EDIT_LEN));
    and change this caracter L"%o" the value retuned in my file change

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Please critique and suggest improvements for parser
    By Queue in forum C Programming
    Replies: 14
    Last Post: 09-28-2006, 08:28 PM
  2. Feedback: Functional Specification Wording
    By Ragsdale85 in forum C++ Programming
    Replies: 0
    Last Post: 01-18-2006, 03:56 PM
  3. char copy
    By variable in forum C Programming
    Replies: 8
    Last Post: 02-06-2005, 09:18 PM
  4. i am not able to figure ot the starting point of this
    By youngashish in forum C++ Programming
    Replies: 7
    Last Post: 10-07-2004, 02:41 AM
  5. Converting from Screen to World Coordinates
    By DavidP in forum Game Programming
    Replies: 9
    Last Post: 05-11-2004, 12:51 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21