|
It works! Thanks a lot! I don't know why though?!
Why can't I just return a void and put different parameters for that handler?
|
|
|
|
|
Because the ON_MESSAGE macro expects your handling function to have that particular signature.
In debug build, it appears to work, but in release mode it will generally cause a crash, unless you are very unlucky. If you are unlucky, it will cause a crash in a completely unrelated place, which is extremely difficult to debug.
This is the second time in a week I've posted information about the same 'fix' on CP, so don't feel too bad; it's probably one of the top 10 MFC errors.
Steve S
Developer for hire
|
|
|
|
|
Message handlers are called by the framework and are expected to have a specific signature.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi,
I have a socket based internet application and would like to detect when a network connection goes up and down (preferrably the LAN connection), are there any events to register to?
When I move with my laptop from work to home, the network connection goes down and my chat application tries to reconnect because it sees that the socket was closed. The first reconnect attempt(s) fail and the next reconnect will be delayed for a longer time (e.g. an hour). When I am back home I would like to detect that the LAN connection is up again to trigger an immediate reconnect. I guess messenging application do something similar.
Cheers,
Mark
|
|
|
|
|
Have you considered the ISensNetwork interface?
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Thanks, I am trying to figure out which API to use. Just googling gives you many suggestions....
- IP Helper API: NotifyAddrChange()
- ISensNetwork: ConnectionLost() and ConnectionMade()
- Winsock: WSAIoctl(..., SIO_ADDRESS_LIST_CHANGE, ...)
- WinINet: InternetGetConnectedState()
- RasEnumConnections() together with InternetGetConnectedState()
Currently I am a bit lost, more details/experience would be great!
|
|
|
|
|
Any ideas out there why the Release build has lower performance than the Debug build.
build machine: Centrino Laptop, 1.6 GHz
test machine: PIII, 700MHz
project-settings-C/C++-processor: Blend*
The application consists of a MMAPI timer thread that posts messages to a view that displays graphics into the CDC.
The measure of performance is the amount of delay between timer event (sound) and WM_PAINT (picture).
thanx in advance
|
|
|
|
|
I would have to say it's the slower processor in your test machine.
|
|
|
|
|
Both Release and Debug builds were tested on the same machine (the P-III test machine). Thanks.
asta la vista baby
|
|
|
|
|
Hi !!!
I have Visual C++ 8.0 Compiler. When I have precompiled headers file "precomp.h" and its cpp file "precomp.cpp" which is empty, I get always this warning: "precomp.cpp: no public symbols found, archive members will be inaccessible". In other file than it is OK and and clever, but in precompiled headers file NOT. Does know somebody, what should I do?
Thanks !
Bye.
-:KNOX:-
|
|
|
|
|
knoxplusplus wrote: I get always this warning: "precomp.cpp: no public symbols found, archive members will be inaccessible". In other file than it is OK and and clever, but in precompiled headers file NOT. Does know somebody, what should I do?
Select that warning by single clicking on it. Do not double click. Press F1. This should give a detailed description as to what's the matter.
Nibu thomas
A Developer
Programming tips[^] My site[^]
|
|
|
|
|
What line of code do I use to print a line of dashes?
|
|
|
|
|
This is a joke, right?
Steve S
Developer for hire
|
|
|
|
|
No, I'm serious. I am a beginner.
|
|
|
|
|
Can you be more specific
whitesky
|
|
|
|
|
Obviously, since this should be in 'Operating Systems'
If you mean in a shell script, it is the same as for a Windows command prompt,
echo '-------------------------------'
although in Windows you probably wouldn't use quote marks.
There is no such command in vi, since you'd just go into insert mode and type; if you wanted to substitute dashes for blank lines something like
:1,$s/^$/--------------------------------------------------------/
would do it, or at least, it has on the versions of UN*X I've used where vi existed, although in some of the earlier ones I used, we had to make do with ed or sed.
Steve S
Developer for hire
|
|
|
|
|
How to hide (or not to create) the menu of an MDI project ...Thanks!
Too many plans make the health badly!!
|
|
|
|
|
|
I use already:
SetMenu(NULL);
::DestroyMenu(GetMenu()->GetSafeHmenu());
Every time that I create child “window” I use the code over but the result is not appreciable.....
Any idea ?
Too many plans make the health badly!!
|
|
|
|
|
I have to map (one to one,one to many) data frm two csv files taken in two tree controls ,th final output in a list control as mapped data.The problem i m facing is of bifurcating the data in the form of nodes(parent,child)to store it in tree control in MFC .Suppose the there is a text file and the data is like this
(0)GrandParentA(space)(1)ParentA(space)(1.1)ChildA(space)(2)ParentB(space)(2.1)ChildB(3)ParentC(space)(3.1)ChildC(space)(3.2)ChildC(space)
Now how to break this data in the form of Parent node and child node to store it in tree using Insert Item .
If any one knows its a humble request on my part to please explain through an example code .
my ids coolands@gmail.com
coolands@sunguru.com
ANDY
|
|
|
|
|
HTREEITEM hRoot = m_tree.InsertItem(_T("(0)GrandParentA"));
HTREEITEM hParent = m_tree.InsertItem(_T("(1)ParentA"), hRoot);
m_tree.InsertItem(_T("(1.1)ChildA"), hParent);
hParent = m_tree.InsertItem(_T("(2)ParentB"), hRoot);
m_tree.InsertItem(_T("(2.1)ChildB"), hParent);
hParent = m_tree.InsertItem(_T("(3)ParentC"), hRoot);
m_tree.InsertItem(_T("(3.1)ChildC1"), hParent);
m_tree.InsertItem(_T("(3.2)ChildC2"), hParent);
|
|
|
|
|
Greetings:
I am trying to create a custom list control. Its just a specialized List Control that I will use repeatedly in several different dialogs and property pages. But I have hit a bit of a snag:
I was handling the LVN_ITEMCHANGED message with OnLvnItemchanged, generated by Class Wizard. That was working fine. But then I also needed to handle LVN_ENDLABELEDIT with OnLvnEndlabeledit. For some reason which I do not understand, the introduction of the LVN_ENDLABLEEDIT handler has stopped the LVN_ITEMCHANGED message from being issued.
Can anybody advise? I need to handle both of these messages...
Thank you,
Mark
-- modified at 9:14 Monday 17th July, 2006
|
|
|
|
|
Hello comunity,
when i start my application they use ca. 10mb ram, ok, than when i open a file, they have, for example if this is a big file, ca.100mb, this is ok to, but now when i close this file, and free all global variables, my application should have again ca. 10mb like from beginning, right?
But this is not the case, my application stil have ca.70MB, 60MB more then normal, where is the memory???!!!
How to find where is the used memory RAM???
I can't find any memory leaks! is there any tool to do this?
with best regards
break;
|
|
|
|
|
Sure, there are tools to find memory leaks.
First, though, consider that the memory count reported by windows will include both allocated memory (ie new or malloc'd memory) and memory held by the CRT. If you new enough memory and the CRT has to ask windows for more heap, it may hold on to it even after you delete / free it so it has enough for your (presumably also large) future requests.
If you are trying to debug memory leaks, try using Rational Purify, DevPartner Studio, or similar products. Be aware, though, that most of these start at $1000+ / seat, though they are more than worth the investment ITO dev time.
earl
|
|
|
|
|
Hi all,
I want to Replace My Menu which is Created From
Resouce -> Menu
After creating the Menu at Design Time i have to attach that menu to my CForm View Replacing the Default Menu Item which is created by the MFC Wizard. Please let me know the Process.
Because if i comment the Default Menu Created in CMainFrame::OnCreate(...) Member function it is giving error. How to Replace the Existing Default Menu with the New menu Which i have crated in CFormView Only.
uday.
|
|
|
|