EndDialog returns an INT_PTR. An INT_PTR is guaranteed to be big enough to hold either an int or a pointer. This means that you can safely return a pointer which is cast to an INT_PTR.
Here is some quick sample code. Error checking is omitted.
/* Set up the string to return. */
char* pszStudentName = (char*) malloc(255);
strcpy(pszStudentName, "Joe Blogs");
/* Return string. */
EndDialog(hDlg, (INT_PTR) pszStudentName);
If you have the old header files, INT_PTR will not be defined. Simply add the following to the top of your file.
/* Receive returned string. */
char* pszStudentName = (char*) DialogBox(...);
/* Free returned string when done. */
If you are using C++, consider using new/delete in place of malloc/free.
typedef int INT_PTR;