我想使用GetFileVersionInfoSize和GetFileVersionInfo Windows方法。问题在于GetFileVersionInfoSize方法始终返回0。
DWORD dwDummy;
DWORD dwResult;
LPCWSTR pcwMyFile = L"myFile.txt";
LPVOID buffer;
dwResult = GetFileVersionInfoSize(pcwMyFile, &dwDummy);
//dwResult always 0
buffer = static_cast<LPVOID>(malloc(dwResult));
bool bResultInfo = GetFileVersion(pcwMyFile, 0, dwResult, buffer);
//bResultInfo always false
//I think the error comes from the GetFileVersionInfoSize method.
//But I do not understand or I make the mistake.