MFC is a C++ Framework for creating GUIs. One of many frameworks, in fact. They are lots and lots of frameworks for GUI programming. A lot are written in C++, some in C.
TCHAR is a define that allows your program to be compiled as both char or wchar_t without problems.
Basically, all you do is use TCHAR instead of char or wchar_t and append _T or TEXT around every string literal:
Then you can compile it either with char or wchar_t without modifications.
Glad to see some of you picked up that it was C++ish pseudocode.
In the case where C is being used, I think passing in the buffer is a good way to go.