In C++ è obbligatorio usare un cast per malloc, calloc e realloc
codice:
pVarNome = (TCHAR*) calloc(iLunghezza + 1, sizeof(TCHAR));