I have a CSpinButtonCtrl in a dialog box and want to check changes to its value only after the user releases the mouse button. It seems that the spin control sends WM_VSCROLL messages with SB_THUMBPOSITION set even before the user releases the mouse button. Can anyone tell me how to process only the final message, and not all the ones in between (I don't think WM_LBUTTONUP would do it, since I need to determine which control it came from, and that message doesn't seem to tell me that.)
What I said was that WM_LBUTTONUP was not the answer to my problem because I'm using information (given to me through OnVScroll) about which control sent me the message.
I want to know how to process a change to a value in a spin control only after the user releases the mouse button.
I already know the difference between SB_THUMBPOSITION and SB_THUMBTRACK. The use of SB_THUMBTRACK would be decidedly unhelpful. If you don't know the answer to my question, don't waste my time by pretending I asked some other, obviously stupid, question.
I just upgraded my compiler from VS2003 to VS2005 SP1 and when I attempt to display
a modal dialog which is contained in a DLL, I get an assertion (in DEBUG only).
I have traced the problem to the following line of code :
if ( AfxGetApp()->IsKindOf( RUNTIME_CLASS( COleControlModule ) ) )
TRACE(traceAppMsg, 0, "Warning: Creating dialog from within a COleControlModule application is not a supported scenario.\n");
What I found is AfxGetApp() is returning NULL when I call it from my DLL, which causes the assertion in IsKindOf(...)
I also found that is is a "bug" with VS SP1.
Has anyone figured out how to make this call work.
BTW, I do make a call to "AFX_MANAGE_STATE(AfxGetStaticModuleState());" immediately after entering my DLL function.
Few other notes which might be of interest:
I am building MFC as a static lib (company requirement)
I am statically linking (not calling LoadLibrary) for the DLL
I skate to where the puck is going to be, not where it is. --Wayne Gretzky
DLLs are always linked dynamically, at runtime, so the same rules apply whether you use
early binding (ie an import library) or late binding (ie LoadLibrary()) to link an app to a DLL.
I am doing early binding. Could my problem be that I do not have a class which is derived from CWinApp?
I have a normal C++ class (as an interface to my exe) which then displaysthe dialog...
Here are the class declarations
As I stated before, this worked without a problem in VS2003, it just when I went to VS2005, I saw this problem
Here are the definition for the classes in my DLL
This class is the interface between my application and my dialogs:
Russell Gantman wrote:
Could my problem be that I do not have a class which is derived from CWinApp?
Yes, definitely and most likely
Thanks a lot for your help, that did it.
All I had to do was add another class derived from CWinApp and instantiate an object of that type and the assertion
went away. It really makes sense since there was no CWinApp object which means AfxGetApp has nothing to get
I skate to where the puck is going to be, not where it is.
Have any one of you migrate any VC++ (using MFC, ver 6.0) program from Windows 32 bit operating systems (XP, 2000, ME, 98SE) to Windows Vista? If so, can you please share some of the problems you have faced and there resolutions? (I heard that Vista has a memory issue if somebody uses malloc/calloc functions). Any additions to this list (with/without resolution)?
I would use either TBB mentioned above, or use Qt. The primary reason is that most threading libraries lack thread compatible containers for data. TBB will be easier to code since it is higher level than most thread classes, but it still amounts to the same thing: you insert the code into a skeleton codeset. If you are simply using threads for scientific problem solving you may not need the storage containers, still it is nice to have.
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
I'm not sure what it is called not do I know how to do it, hence this is why I'm here . I'm trying to develop an application (very simple at first) that resembles a Microsoft Window, i.e it must have object that one can click on that will open other applications. Makes sense ??
Can anyone please help me in this regard ?
Many thanks in advance
The only programmers that are better that C programmers are those who code in 1's and 0's
That's more than a little vague - or a bunch of questions.
The open other applications for example...
Do you mean bring running applications to the foreground?
Do you mean run new programs? If so, read up on ShellExecute, or CreateProcess.
How will this be presented to the user?
A few buttons on a dialog that run hard coded programs?
Read a list of programs from shortcuts in a directory?
An editable list?
Will you extract the appropriate Icon from the executable so you can show a pretty pic to the user?
As you can see, this is multiple tasks. If you can more clearly define them, you may get help with individual ones. At the moment it looks like: "I have to write something, and I'm not even sure what it needs to do. Can you do it for me?". And that's a rapid road to being ignored.
You've asked many questions here on quite complex subjects, and even answered some. So none of the above should stretch you too far.
Last Visit: 31-Dec-99 18:00 Last Update: 3-Aug-21 19:26