|
|
ThatsAlok wrote:
I Believe, you are facing trouble using GetFileVersionInfoSize...
Why would there be trouble in using GetFileVersionInfoSize() ? Aside from reading the EXE/DLL directly, that function, along with VerQueryValue() , are the only way to go.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
thanks to both of U dear but I m not able to get desired o/p
below is sample code I m doing, I m getting Invalid data Error (13)
====================
DWORD dwVerInfoSize; // Size of version information block
DWORD dwVerHnd = 0; // An 'ignored' parameter, always '0'
TCHAR *szAppName= L"C:\\Documents and Settings\\Desktop\\unicows.exe";
TCHAR *verdata = L"";
//WIN32_FIND_DATA var;
//HANDLE hFileHandle = FindFirstFile (szAppName,&var);
dwVerInfoSize = GetFileVersionInfoSize( szAppName, &dwVerHnd );
cout << dwVerInfoSize; // here I m getting o/p as "2052"
GetFileVersionInfo(szAppName,0,dwVerInfoSize,verdata);
LPVOID lpInfo;
UINT unInfoLen;
VerQueryValue(verdata, _T("\\"), &lpInfo, &unInfoLen);
cout<< "lpInfo : " << lpInfo<<"\n\n"; //o/p is 0xccccccc
cout<< "unInfoLen :" << unInfoLen; // o/p is zero
cout<<"\n"<< GetLastError(); //13
========================
tell me what's wrong in it...
thanks n Regards
Supriya Tonape
-- modified at 6:27 Friday 16th September, 2005
|
|
|
|
|
Supriya Tonape wrote:
GetFileVersionInfo(szAppName,0,dwVerInfoSize,verdata);
Here verdata does not point to a valid block of memory. See here for code snippets that use these functions.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Thanks David It did help n I got the o/p. It's in decimal ,I will check out how to get it in the format #.#.#.#
bye n have a nice week end
Regards
Supriya Tonape.
|
|
|
|
|
Supriya Tonape wrote:
,I will check out how to get it in the format #.#.#.#
The variables for that are also mentioned in that article.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Hi David,
Can U plz explain how to get file version in #.#.#.# I m not getting how to get it after VerQueryValue().
thanks in advance
Supriya Tonape.
|
|
|
|
|
Hi David,
I got it, dont look into this now
bye
Supriya Tonape
|
|
|
|
|
typedef struct _verStruct<br />
{<br />
unsigned short Minor;<br />
unsigned short Major;<br />
}VerStruct;<br />
stringstream SS;<br />
char *pBuff;<br />
char SubBlock[255];<br />
VerStruct *MajorVer,*MinorVer;<br />
WORD wCountry = 0x0409;<br />
WORD wCodePage = 0x0000;<br />
void *Base;<br />
VS_FIXEDFILEINFO *FileVerInfo;<br />
unsigned int Length;<br />
pBuff=NULL;<br />
<br />
string FileName;<br />
try<br />
{<br />
strcpy(SubBlock,"");<br />
FileName = "SomeFile"<br />
Length = GetFileVersionInfoSize(FileName.c_str(),0);<br />
pBuff = (char *)calloc(sizeof(char),Length);<br />
GetFileVersionInfo(FileName.c_str(),NULL,Length,pBuff);<br />
DWORD ErrorNum = VerQueryValue(pBuff,"\\",(void **)&FileVerInfo,&Length);<br />
Base = &(FileVerInfo->dwProductVersionMS);
MajorVer = (VerStruct *)Base;
Base = &(FileVerInfo->dwProductVersionLS);<br />
MinorVer = (VerStruct *)Base;<br />
}<br />
catch(...)<br />
{<br />
string Message = "Unable to determin the Local version";<br />
_bstr_t OutMessage = Message.c_str();<br />
return Error((BSTR )OutMessage);<br />
}<br />
SS << MajorVer->Major << "." << MajorVer->Minor << "." << MinorVer->Major << "." << MinorVer->Minor;<br />
_bstr_t OutVal;<br />
OutVal = SS.str().c_str();<br />
*pVal = OutVal.copy();<br />
return S_OK;
a programmer traped in a thugs body
|
|
|
|
|
Hey Hi,
Thanks a lot, Ur snippet did help me to solve my probs
thanks again n bye
Supriya Tonape
|
|
|
|
|
Hi All
I am making a dialog based application using MFC.
I have written a function which is as follows:
Function(CString strPath)
{
CString strTempPath;
strTempath = strPath;
}
Now when i debug this function then as soon as control passes line "strTempath = strPath;"
It causes UNHANDELED EXCEPTION ERROR.
Why it is happening?
Please reply.
Thanks
|
|
|
|
|
rajeevktripathi wrote:
Function(CString strPath)
{
CString strTempPath;
strTempath = strPath;
}
Could you show me your actual coding and what actual value coming in strPath..
OT: try to follow nominal Variable naming convention while coding
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Can you tell wots the exact error message. I feel your memory was already corrupted some time before it reached the Function(), but unfortunately its showing only from Function().
suhredayan There is no spoon.
|
|
|
|
|
You better rebuild the application again.. It might help..
" Action without vision is only passing time,
Vision without action is merely day dreaming,
But vision with action can change the world "
- Words from Nelson Mandela
Thanks & Regards,
Gopalakrishnan
|
|
|
|
|
Hi!
I have a question about afx-message-handling in a MFC-Dialog (VS.NET 2003, WinXP).
I've got a main Dialog (CDialog) and a Child-Window in it (CStatic).
The goal is to handle afx-messages from the CStatic (ie. ON_WM_LBUTTONDOWN()) .
I did use the standard afx-message-map-mothod (ie. mapping ON_WM_LBUTTONDOWN() to afx_msg void OnLButtonDown(UINT nFlags, CPoint point)), but nothing happens.
Only the messages and handlers of the Main-Dialog are working.
I tried to put the focus on the Child-Window manually - no sucess. I tried to use CWnd instead of CStatic - no sucess.
Perhaps the CDialog messages are blocking the messages of the CStatic?!
Im really new in this and need a hint.
thanks in advance!
_NielsB
|
|
|
|
|
|
Include this style: SS_NOTIFY with the CStatic.
m_Static.ModifyStyle(0,SS_NOTIFY);
this is this.
|
|
|
|
|
|
Sir
I am working as a developer in a company
which is about to develop a VOIP communiction
terminal, i need help for the firmware & coding
Meaning is there any Good SoC available in market
for VOIP , or if ther any Stack available for Voip.
Currently we making a feasibility study by making a
small project in VC++ and implementing VOIP on LAN.
Were can i find the refrences for H.323 & SIP ?
If u know any forum from were i can get help let me know
Eager for your reply
vikas.amin@embin.com
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
How to load bitmaps on to the dialog box
Plz give a simple code to understand.
Because I am new to MFC
Praveen Chowdam Kumar
|
|
|
|
|
|
hello,
i'm developping a database application in visual c++ and i want to vue and print report from database access 2000.
How can i process ?
help me please!
hervy
|
|
|
|
|
I developed an application ,In which it popup messages to a respective time.
I used OnTimer() function .,
When I move my mouse cursor on to the application , It starts blinking.
How to avoid this Blinking.
Plz reply urgently.
Praveen Chowdam Kumar
|
|
|
|
|
Message boxes are Modal. You must dismiss them if you want to go back to the application.
The solution is to create your own "Custom Message Box", which is Modeless, created on-the-fly using Create(IDD_MY_BOX,this); Shown, using ShowWindow(SW_SHOW); etc.
Then you can click on the application window also while the message box is present.
I hope I understood your question.
this is this.
|
|
|
|
|
Hi, I'm working on having a CToolBar in my application, but with a difference. Instead of having the toolbar docked to a framewnd, I have the toolbar sitting inside a dialog of mine. The technique works just fine, and the toolbar behaves itself perfectly. However, the standard CToolBar seems to paint a "toolbar-background" underneath the CToolBarCtrl, which when you are not docking the toolbar inside a window is rather unsightly. Does anyone know how to make the background transparent?
Joel Holdsworth
|
|
|
|