I think the problem is in the last param of the function.
Thats how everything should look and that should work, the only other thing i can think of is that 36 chars may not be big enough to hold the string or maybe it is?, also make sure you are using this code inside your dialog proc function so you have the right handle for the first parameter (hwnd). And if it still dosnt work then im not sure but check that NAME is the correct ID and everything.... but as i say i think the code i gave you should fix it.
TCHAR name; //this is the buffer for the text to be stored in
//now execute the function
GetDlgItemText(hWnd, NAME, name, sizeof(name));
Hope thats of some help,