|
Infact it's CWnd::SetWindowText()
|
|
|
|
|
Bana in Pyjama wrote: Infact it's CWnd::SetWindowText()
What's this in response to? I was asking about SetWindowValue() . I see it is a method of your CEditWithScrollBar class, but how/when it gets called has not been indicated.
"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
|
|
|
|
|
SetWindowValue() is my own function. I made it, to replace having to convert a numeric value to a string before calling SetWindowText(). So it is called whenever SetWindowText() would have been called. I did this because I noticed that this:
CString sText;
sText.format("%f", dValue);
m_edit.SetWindowText(sText);
and then:
CString sText;
m_edit.GetWindowText(sText);
dValue = atof(sText);
was all over my code.
Sorry for not beeing clear enough at the start.
|
|
|
|
|
Thx for the replies! But the answer from Steve S has solved my problem.
|
|
|
|
|
Change your handler to afx_msg LRESULT OnApply(WPARAM, LPARAM), have the method return 1L, and try that in both debug and release mode.
Steve S
Developer for hire
|
|
|
|
|
I'll try that right now.
Thx for the quick response too!
|
|
|
|
|
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!!
|
|
|
|