I added a version resource to my file (dll) and I want to read it in that same file. (the version info is ther in explorer so that works I think)
I'm using "VerQueryValue" but I don't know if this is the best way to do it. I think there must be a better way because its't the same file that contains the resource.
here's the code I'm using.
edit: versioninfo_size gets it size as it should (I think)Code:DWORD versioninfo_size; DWORD buffer; void *versioninfo; void *data; UINT uint; versioninfo_size=GetFileVersionInfoSize ( "filename.dll", &buffer); GetFileVersionInfo("filename.dll",NULL,versioninfo_size, &versioninfo); VerQueryValue(versioninfo,"\\StringFileInfo\\081304b0\\FileVersion",&data,&uint);
VerQueryValue gives me a unhandled exception.
could this be that it is because the code is in the same file as the resource???
I got 081304b0 from the .rc (don't know if I'm allowed to do this)
What am I doing wrong?
compiler: MSVC++ 6