GetCurrentDirectory 并不帮你分配内存,你要用:
LPTSTR lpBuf;lpBuf = Dir.GetBufferSetLength(_MAX_PATH);
GetCurrentDirectory(lpBuf);