I'm not sure about this, but maybe you're not using the 'MessageBox' Function correctly. Here it is defined in the msdn:
int MessageBox(
HWND hWnd, //Handle to the owner window
LPCTSTR lpText, //Pointer to null terminated string
LPCTSTR lpCaption, //Pointer to null terminated string
UINT uType //Specifies content and behavior
);
I think you might be getting mixed up in the 2nd argument of the 'MessageBox' function. If you want to know for yourself, lookup 'LPCTSTR' somewhere, but I think you just put in an address of the character array. (Why all of the excess?)
NOTE: This might go with the 'GetDlgItemText' function as well.
char InPassLocalArray[ 21 ];GetDlgItemText( hDlg, IDC_EDIT1, &InPassLocalArray, strlen( InPassLocalArray ) - 1 ); string sInPassLocal = InPassLocalArray;g_sPassword = InPassLocalArray; //What's this for?////////////MessageBox( g_hWnd, sInPassLocal.c_str(), "Your input", MB_OK | MB_ICONINFORMATION ); ////////////
I would again suggest looking up the definition of a 'LPCSTR' to get a better grip on this problem.
EDIT: Try doing something with the null-terminated character.