Can anyone give me an example using the combination of these 3 APIs?

GetFileVersionInfoSize
GetFileVersionInfo
VerQueryValue


I can get the first two to work, but get a memory access violation on the third one. I really suck at C++ seeing as how ive only just started learning it yesterday, but i have written a small console app for a guy here at work, and he wants to be able to see the version, so i am trying to figure these ones out.