|
I've a user defined message defined as :
#define UDM_TREEITEMCHECKBOX_CLICKED (WM_USER + 3)
the handler is :
LRESULT CTreePropSheet::OnTreeItemCheckBoxClicked(WPARAM wParam, LPARAM lParam)
{
--
}
When I modify the user defined message as :
#define UDM_TREEITEMCHECKBOX_CLICKED (WM_USER + 1) //(which is unique and no other user defined message is defined so)
then,
there is a crash in my application.
A snippet of the call stack contents looks like this :
For (WM_USER + 3) : (Successful case)
TreePropSheet::CTreePropSheet::OnInitDialog() line 773
CPropertySheet::HandleInitDialog(unsigned int 460026, unsigned int 460026) line 1209 + 14 bytes
CWnd::OnWndMsg(unsigned int 272, unsigned int 460026, long 1452200, long * 0x0013f03c) line 1815 + 17 bytes
CWnd::WindowProc(unsigned int 272, unsigned int 460026, long 1452200) line 1585 + 30 bytes
AfxCallWndProc(CWnd * 0x0013f438 {TreePropSheet::CTreePropSheet hWnd=0x00080500}, HWND__ * 0x00080500, unsigned int 272, unsigned int 460026, long 1452200) line 215 + 26 bytes
AfxWndProc(HWND__ * 0x00080500, unsigned int 272, unsigned int 460026, long 1452200) line 368
AfxWndProcBase(HWND__ * 0x00080500, unsigned int 272, unsigned int 460026, long 1452200) line 220 + 21 bytes
For (WM_USER + 1) : (Unsuccessful case)
TreePropSheet::CTreePropSheet::OnTreeItemCheckBoxClicked(unsigned int 1, long 0) line 1148 + 14 bytes
CWnd::OnWndMsg(unsigned int 1025, unsigned int 1, long 0, long * 0x0013e310) line 1815 + 17 bytes
CWnd::WindowProc(unsigned int 1025, unsigned int 1, long 0) line 1585 + 30 bytes
AfxCallWndProc(CWnd * 0x0013f438 {TreePropSheet::CTreePropSheet hWnd=0x001a0222}, HWND__ * 0x001a0222, unsigned int 1025, unsigned int 1, long 0) line 215 + 26 bytes
AfxWndProc(HWND__ * 0x001a0222, unsigned int 1025, unsigned int 1, long 0) line 368
AfxWndProcBase(HWND__ * 0x001a0222, unsigned int 1025, unsigned int 1, long 0) line 220 + 21 bytes
Actually, in Successful case, the OnTreeItemCheckBoxClicked() is not required to be called (as is happening in Unsuccessful case) because the event
(of clicking tree item) as such has not occurred at all.The crash arises before launch of my dialog (which contains the tree control) itself.
Can the cause of the crash be figured out from the call stack contents ?
It appears that third and fourth (or either) parameters of the following function is causing the problem
AfxWndProcBase(HWND__ * 0x001a0222, unsigned int 1025, unsigned int 1, long 0) line 220 + 21 bytes
But, AfxWndProcBase() is a function called/modified by the Application Framework.
What can I do to avoid the crash with (WM_USER + 1) ?
Or is there any other justifiable reason for not using (WM_USER + 1) ?
Any help would be appreciated.
Thanks in Advance.
|
|
|
|
|
SherTeks wrote: Or is there any other justifiable reason for not using (WM_USER + 1) ?
Read here[^]
and here[^]
I hope it helps.
Regards,
Sandip.
|
|
|
|
|
Thanks for the reply.
The message was probably getting sent from one window to other bcoz
the crash occurred after I clicked 'Ok' of one dialog and before the other
dialog was launched.
Defining WM_APP in lieu of WM_USER worked fixed the problem.
|
|
|
|
|
SherTeks wrote: #define UDM_TREEITEMCHECKBOX_CLICKED (WM_USER + 1) //(which is unique and no other user defined message is defined so)
Are you 100% sure? The answer may surprise you.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hi,
I need to develop an application which would connect me to a telnet server for only one command DIR and display the directories in a tree view.
Here I am not supposed to use the command prompt window.
All the programs including Puttyhttp://en.wikipedia.org/wiki/PuTTY[^].. open up a command prompt when trying to connect to a telnet server.
Could you please help me up with some sample articles.. or what to search for..
Priya Sundar
|
|
|
|
|
Priya_Sundar wrote: Hi,I need to develop an application which would connect me to a telnet server for only one command DIR and display the directories in a tree view.
Can you use CFtpFileFind for this, or this?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hi all,
I have a COM project which stores its properties with an OLE Property api... I'm not even sure of the terminology, so google isn't helping.
Basically, the program loads / stores properties in an XML file.
How do I load this xml file? The API call when a user-interface is generated for these properties is "OleCreatePropertyFrame(.......)"
Thanks
[edit] even pointing me in the right direction to learn more about ole property etc. stuff.
modified on Wednesday, October 29, 2008 5:47 PM
|
|
|
|
|
hi,
is there any function, library or just trick how to get information
if HDD in system is SATA or PATA?
thank you
viliam
|
|
|
|
|
A trick: check the cable.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
But which cable I can see different cables with different colors?
|
|
|
|
|
Oh yes, first have a look at the color, it is very important, then, in the spare, time you may also check how many wires the cable has.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: ...you may also check how many wires the cable has.
How's he supposed to know that until he first knows how many ends the cable has?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Uh, has the cable actually ends?
BTW welcome in the THHB , David [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
modified on Thursday, October 30, 2008 4:48 PM
|
|
|
|
|
CPallini wrote: Uh, has the cable actually ends?
Yes, some have up/down ends, while others have left/right ends. You have to be careful how you orient the cable, because if the bits flow in the wrong direction...well, it's just messy.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
DavidCrow wrote: You have to be careful how you orient the cable, because if the bits flow in the wrong direction...well, it's just messy.
Oh, that's very simple: you've just to be sure it is aligned with the Earth's magnetic field.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: Uh, has the cable actually ends?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
I meant programming way
I know what is inside but how to "learn" program
viliam
|
|
|
|
|
Hello !
So I started having fun with global subclassing. I install a global hook from a DLL and it changes every button's text. It works for every process except for explorer; explorer.exe's buttons aren't changed... Thank you very much as I've been looking a long time for a solution !
<br />
LRESULT CALLBACK MyWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)<br />
{<br />
if (msg == WM_PAINT)<br />
{<br />
SetWindowText(hWnd,"text");
}<br />
<br />
return(CallWindowProc(pOldWndProc, hWnd, msg, wParam, lParam));<br />
}<br />
<br />
<br />
LRESULT CALLBACK HookProc(int code, WPARAM wParam, LPARAM lParam)<br />
{<br />
return(CallNextHookEx(hHook, code, wParam, lParam));<br />
}<br />
<br />
BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)<br />
{<br />
hMod = (HINSTANCE) hModule; <br />
<br />
if (ul_reason_for_call == DLL_PROCESS_ATTACH)<br />
{<br />
HWND hWnd = CreateWindow("BUTTON","",0, 0, 0, 0, 0,NULL, NULL, hMod, NULL); <br />
pOldWndProc = (WNDPROC)SetClassLong(hWnd,GCL_WNDPROC ,(LONG)MyWndProc);
DestroyWindow(hWnd);<br />
}<br />
return TRUE;<br />
}<br />
<br />
__declspec(dllexport) void DemarrerHook()
{<br />
hHook = SetWindowsHookEx(WH_CALLWNDPROC, HookProc, hMod, 0);<br />
}
|
|
|
|
|
Hi all!
I am doing localization for a software. I've finished most of it except for some MFC default messages. For example:
File / Exit / MessageBox "Save changes in Untitled ?" Yes, No, Cancel
Under English Windows XP, if I run ENG version of my application, the result is fine, which is: "Save changes in Untitled ?". However, when I ran JPN, CHN or KOR version of this, the results were in unknown characters, like a mess.
I haven't tried it under East Asian Windows XP yet, but still, it would be nice it runs normal under English Windows XP. BTW, before localization, I changed this project into UNICODE.
Does anyone know how to solve this?
Thanks in advance!
Joshua
modified on Wednesday, October 29, 2008 12:02 PM
|
|
|
|
|
|
|
It seems that when I host a CListBox in a CDialogBar, in a CMDIChildWnd, whenever I hit the space bar, the selection index goes down one (I'm actually using CCheckListBox but found the behavior exists in the base class CListBox).
I tried handling OnKeyDown, and skipping the call to the base class handler when nChar == VK_SPACE but it still moves the selection index down one when space bar pressed.
When I use the CListBox in a dialog box, pressing the space bar does not move the selection index down.
Can anyone point me in the right direction to suppress the selection index change when pressing the space bar for a CListBox when hosted within a CDialogBar and CMDIChildWnd?
thanks
(Oops, I forgot to mention I'm using VC++ 2003 and I have an app written with VC++ 6.0 that behaves the same way. Also, Windows 2000 and XP have the same behavior)
|
|
|
|
|
Hi,
Currently I had a file type which will be open with a program i created. The file will be open in the normal windows environment by double clicking on the mouse or hitting the enter button.
Is there anyway to get the file name that open the program in the program?
Thanks in advance.
|
|
|
|
|
Yang Jiayi wrote: Is there anyway to get the file name that open the program in the program?
What?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
|