CString CAboutDlg::GetFileComment(void) { CString ret; DWORD size, dw; TCHAR path[_MAX_PATH + 1]; LPVOID lp, lpbuf; UINT usize; ret.Empty(); if (::GetModuleFileName(NULL, path, _MAX_PATH) != 0) { if ((size = ::GetFileVersionInfoSize(path, &dw)) > 0) { if ((lp = ::GlobalAlloc(GMEM_FIXED, size)) != NULL) { ::GetFileVersionInfo(path, 0, size, lp); ::VerQueryValue(lp, _T("StringFileInfo41103a4Comments"), &lpbuf, &usize); if (usize > 0) { ret = (LPCTSTR)lpbuf; } GlobalFree(lp); } } } return ret; }