Need to compare dialog edit box text with string table string

I have a dialog box that has an edit box in it.

I need to take the text that the user enters here, store it as a string if possible, load a string from a resource file, and then compare the two strings.

I need the entire process mapped out if possible. I'm having no luck with GetDlgItemText and LoadString functions.

Is there anyone out there who would be will to message back and forth in real time over AOL Instant Messenger? It would be a big help if someone could help me with this big time.

I have no way around any of this. I am using this to implement security and must compare the two strings before giving anyone access to the protected data that will be accessable from within the program.

Comments

  • : I have a dialog box that has an edit box in it.
    :
    : I need to take the text that the user enters here, store it as a string if possible, load a string from a resource file, and then compare the two strings.
    :
    : I need the entire process mapped out if possible. I'm having no luck with GetDlgItemText and LoadString functions.
    :
    : Is there anyone out there who would be will to message back and forth in real time over AOL Instant Messenger? It would be a big help if someone could help me with this big time.
    :
    : I have no way around any of this. I am using this to implement security and must compare the two strings before giving anyone access to the protected data that will be accessable from within the program.
    :

    What problems are you having with GetDlgItemText()?

    Med venlig hilsen,

    Adrian...


  • : : I have a dialog box that has an edit box in it.
    : :
    : : I need to take the text that the user enters here, store it as a string if possible, load a string from a resource file, and then compare the two strings.
    : :
    : : I need the entire process mapped out if possible. I'm having no luck with GetDlgItemText and LoadString functions.
    : :
    : : Is there anyone out there who would be will to message back and forth in real time over AOL Instant Messenger? It would be a big help if someone could help me with this big time.
    : :
    : : I have no way around any of this. I am using this to implement security and must compare the two strings before giving anyone access to the protected data that will be accessable from within the program.
    : :
    :
    : What problems are you having with GetDlgItemText()?
    :
    : Med venlig hilsen,
    :
    : Adrian...
    :
    : Here is the actual WM_COMMAND dialogproc code that i encapsulated in a seperate function. Sorry if it is a little unreadable.

    BOOL AdminDialog_OnCommand(HWND hwnd, WORD wCommand, WORD wNotify, HWND hControl)
    {
    TCHAR szPass[64], lpPass[64];

    switch(wCommand)
    {
    case IDOK:
    GetDlgItemText(hwnd, IDC_ADMINPASS, szPass, sizeof(szPass) / sizeof(TCHAR));
    LoadString(hInst, IDS_ADMINPASS, lpPass, sizeof(lpPass) / sizeof(TCHAR));
    if(szPass == lpPass)
    {
    DialogBoxParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_KEYCODE), NULL, (DLGPROC)CodeDialogProc, 0);
    }
    else
    {
    MessageBox(hwnd, "Invalid Password! Access Denied", "Alert!!!", MB_OK | MB_TASKMODAL);
    }
    break;
    case IDCANCEL:
    EndDialog(hwnd, 1);
    break;
    }
    return TRUE;
    }


  • instead of:
    [code]
    if (szPass == lpPass)
    [/code]
    use:
    [code]
    if (lstrcmp (szPass, lpPass) == 0)
    [/code]

  • : instead of:
    : [code]
    : if (szPass == lpPass)
    : [/code]
    : use:
    : [code]
    : if (lstrcmp (szPass, lpPass) == 0)
    : [/code]
    :


    I can't thank you enough. I appreciate. It works now. Thank you again.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories