|
Hi,
If I'm implementing a view that recieves WM_COMMAND messages, and OnUpdateCmdUIs, what is the easiest way to include some of my view's child windows in the routing, so that they can also recieve these notifications, without reflecting each notification one by one?
Joel Holdsworth
|
|
|
|
|
It's a bit hacky but I often override OnCmdMsg() and forward it on to the child windows to see if any of them want it.
The two most common elements in the universe are Hydrogen and stupidity. - Harlan Ellison
Awasu 2.1.2 [^]: A free RSS reader with support for Code Project.
|
|
|
|
|
Thanks a lot. Worked like a charm!
Joel Holdsworth
|
|
|
|
|
Hi
I'm writing an application and I would like to add a search function to it. What I would like to have is something similar to the "search file" function from the explorer, but using my own search search parameters and search engine. And this is where I get confused
Browsing the msdn I found two things :
-> Search Handler. I found a little description of what they are in the "Creating Search Handlers"(1) document, but that didn't help me much. What are they really capable of ? Are they the solution to my problem (custom search engine based on custom parameters) or are they just a tool to help XP search in file ? (I mean, like described here )
-> Explorer pane. I was able to implement a vertical explorer pane and adding a few event to it (straight win32 message loop, nothing fancy), but how can I display the search result the same way they are displayed when searching for file ? (To clear a bit this : I receive the "search" event. My app looks input values and perform the search. How can I present the results in the right pane (the listview) of the explorer ?)
Thanks !
-----------------------------
(1) Creating Search Handlers
|
|
|
|
|
I have an MFC MDI application in VC++ which is active document server application which allows opening document in container like internet explorer.
Is it possible to create the active document server application using .NET framework and allow to open document in internet explorer?
Any tips on the same will be helpful.
Thanks.
|
|
|
|
|
HI, can anybody tell me how get File Version without using GetFileVersionInfoSize() do let me know.
Thanks in advance.
Regards,
Supriya Tonape
|
|
|
|
|
|
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
|
|
|
|