   GetDlgItemText problem
  First I'm declaring the varible I'm using like this:char Text[17];and using the finction like this:GetDlgItemText(hDlg, IDC_TEXTEDIT, (LPTSTR) Text, sizeof(Text));but only the first letter input of the text edit is getting copied to the array. Anyone have a solution for this so that the entire inpute gets copied to the array?   
  Is your project set to Unicode? If that's the case you can use the TCHAR define:TCHAR Text[17];GetDlgItemText(hDlg, IDC_TEXTEDIT, (LPTSTR)Text, 17 );This gets you the text in unicode format though, to get ASCII from it, you can use the WideCharToMultiByte function.Edit: AP is right, removed the sizeof.[Edited by - Endurion on June 18, 2006 4:07:17 AM];  just fyi, you shouldn't be casting to (LPTSTR). LPTSTR is #defined as either char for an ANSI build or wchar_t for a Unicode build. also, using sizeof is incorrect for Unicode character arrays, as sizeof returns the number of bytes in the array and the function wants the number of characters. the following macro returns the number of characters in an array regardless of the build type.#define SIZEOF(x) (sizeof(x)/sizeof(x[0]));  but if I don't cast it it won't let me use my variable there.   ;  You cannot cast between wide character strings (Unicode) and narrow character strings (char). Either use MultiByteToWideChar() to convert your string or use TCHAR instead of char.Preferably, I would use TCHAR and wrap all string literals in the TEXT() macro.   ;  That fact that you have to cast should be a clue that your code may be wrong.  This isn't always true (especially with some of the more generic Windows functions) but it a warning sign.  If you ever use a cast and don't know exactly why you have to use it then you should stop and figure it out.  And "the compiler complains if I don't" isn't sufficient - that just means you have to understand why the compiler is complaining.You should either turn off Unicode support in your project (sorry I don't know how to do this offhand, it should be somewhere in MSDN), or you should use WCHAR rather than char.  I recommend the former until you get more understanding of what Unicode is and this whole issue you're hitting.Personally I'd avoid using TCHAR and TEXT.  Those macros are only useful if you want to be able to compile both with and without Unicode support, and realistically, practically nobody needs that.   