I have stumbled my way through getting this code to work.. Mostly guess work and looking at someone else's code on this subject. I am confused about how things are working. I have several questions on this code marked throughout.. Hopefully someone can explain what I am confused about..
////////GET PRODUCT VERSION INFORMATION
//CONVERT CString To LPTSTR
1.) Is this a good technique for converting an object of CString to LPTSTR? It seems to work?
Filename = new char[strlen(TmpStr)+1];
//GET FILE VERSION SIZE INFO
FileVersionSize = GetFileVersionInfoSize( Filename,&dwHnd);
#2.) Why does this function require a DWORD Handle if it is never used?
//GET FILE VERSION INFORMATION
pBuffer = new LPVOID[FileVersionSize]; //Create Buffer
#3.) when I allocated the memory for pBuffer did I do it correctly for that type (LPVOID)?
#4.) Now this is where I am completly lost. Looking at the documentation for this function under Visual C++ 5.0. How could one determine that the third parameter had to be of type VSFIXEDFILE_INFO? The doc says this parameter "Points to a buffer that receives a pointer to the version-information value." Only after looking at this over and over and looking at someone else's code I came to the conclusion that it had to be an Object of type VSFIXEDFILE_INFO. Why does this parameter have to be a (void **) pointer?
Any help on any of these questions would greatly be appreciated.. Thanks In Advance,