|
#define _WIN32_WINNT 0x0500
#define WINVER 0x0500
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
it doesn't work,it is a link error,I think maybe I miss some .lib file,what to do next?
|
|
|
|
|
I have done all that you said,but failured
|
|
|
|
|
Do you have the latest Platform SDK? If not download it from msdn.microsoft.com[^]
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
I downloaded it only two months ago and include directory is set correctly(new directory is on the top of all .h files path)
|
|
|
|
|
yingkou wrote:
and include directory is set correctly
What about the lib directory?
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
haha,I have forgotten set the .lib directory. thanks everyone
|
|
|
|
|
Hi,
I need a command that will bring my application to the top of the Z order. I'd have thought this task would be fairly simple, but apparantly not: I've tried using
AfxGetMainWnd()->BringWindowToTop() and also
AfxGetMainWnd()->SetWindowPos(&wndTop, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); Neither of these techniques seem to work at all. Can anyone advise me as to what I'm doing wrong?
Joel Holdsworth
|
|
|
|
|
Joel, SetWindowPos() works for me. It's how I implement the "Always on top" feature in my apps.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Joel Holdsworth wrote:
Neither of these techniques seem to work at all.
So what do they do then?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
They don't seem to do anything at all!
Joel Holdsworth
|
|
|
|
|
What does SetWindowPos() return? Have you tried stepping into each to see their behavior?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Correction: BringWindowToTop seems to work once - the first time i call it in application's session, after that it becomes totally ineffective!
Joel Holdsworth
|
|
|
|
|
Hi,
I'm in the process of writing a button control that has "dead man" behaviour. The button will be used to control some machinery, and the customer has asked for this button control that will only allow activity to happen while the mouse button is pressed on it.
I'm making a control that intercepts messages WM_LBUTTONDOWN and WM_LBUTTONUP so that it can notify the backend when the user presses/releases the button. My question is this: Is there is any chance (even the slightest most skinny chance) that delivery of the WM_LBUTTONUP message might fail? I'd imagine that there might be a 1 in a million chance. So does anyone have any advice for implementing this safely?
Joel Holdsworth
|
|
|
|
|
Try pressing the mouse button over the control, moving the mouse away and then releasing the button.
I think this can cause problems but I think you might have to put it over a larger conrol and catch the mouse movements on the larger control, thus the larger control acts as a 'guard rail'.
It's many years since I saw this issue so can't give more info off hand.
Elaine
The tigress is here
|
|
|
|
|
Even having a "guard rail" larger control might not work if the user moves the mouse entirely outside of the application window and then releases the button. The best way to deal with that is to use the SetCapture() function so that the necessary window receives mouse events even if they occur outside the window.
Sincerely,
Alexander Wiseman
Est melior esse quam videri
It is better to be than to seem
|
|
|
|
|
A better way to set up the "Guard Rail" would be to restrict the mouse cursor using the ClipCursor function. See ClipCursor and GetClipCursor in MSDN.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
Good point. ClipCursor will prevent the mouse from even going outside the boundary. For allowing the user to bring the mouse outside the boundary and still handling messages you would use SetCapture .
Thanks for the tip.
Sincerely,
Alexander Wiseman
Est melior esse quam videri
It is better to be than to seem
|
|
|
|
|
Joel Holdsworth wrote:
Is there is any chance (even the slightest most skinny chance) that delivery of the WM_LBUTTONUP message might fail?
It depends what you mean by "fail". The message will be sent (barring a malfunction in Windows), but the time between the user clicking the button and the delivery of the message could be significant. See this[^] article for an alternative way to implement the dead man's feature.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I understand that Microsoft are now giving their Visual C++ Toolkit away for free.
Some websites claim that the compiler is equivalent to the Standard C++ compiler (i.e. not optimizing). On the other hand, Microsoft claim the compiler is the same as their Professional compiler. This seems too good to be true!
Surely one of the main incentives for purchasing .NET Professional is that you get an optimizing compiler?
In other words, what's to stop me just buying C++ .NET Standard (which comes pretty cheap) and, when I've finished developing my app, using the free toolkit to build the final, optimized, distributable exe?
In a nutshell: what's the catch?
|
|
|
|
|
As I understand it, it is the full optimizing compiler.
LiquidEyes wrote:
Surely one of the main incentives for purchasing .NET Professional is that you get an optimizing compiler?
Well, you also get the other three languages if that's of any use to you.
LiquidEyes wrote:
In other words, what's to stop me just buying C++ .NET Standard (which comes pretty cheap) and, when I've finished developing my app, using the free toolkit to build the final, optimized, distributable exe?
As far as I can see - nothing.
Kevin
|
|
|
|
|
Kewl. Thanks for the info.
Given that I'm not interested in the other languages, is there anything else about .NET Professional I should be particularly interested in?
MS seem to imply that it has superior debugging facilities compared with the Standard edition, but if we're just talking fancy-pants stuff like remote debugging and such-like, then I'm not too fussed.
I just want to write Visual C++ apps on my home PC (ultimately, with a view to distributing my apps). I use .NET Pro at work, so I'm wondering whether, when I buy C++ .NET Standard for home use, I'm suddenly going to realise there are a load of missing features that I badly want!
|
|
|
|
|
You can also copy and replace the standard edition's compiler/linker files for the toolkit's compiler/linker files. It has been working for me without problems.
Happy Programming and may God Bless!
"Your coding practices might be buggy, but your code is always right."
Internet::WWW::CodeProject::bneacetp
N-Tech Productions
http://www.n-tp.com/
|
|
|
|
|
But can you set the compiler's "Optimize" switches? The Standard IDE won't let you select any optimization, and I wonder if it removes any that you manually add...
Any experience with optimized output from Standard Edition with replaced compiler/linker files?
|
|
|
|
|
Unfortunately, it appears that the optimization switches are still disabled with or without the compiler files in place.
I don't really have any experience with optimized output in the Standard Edition. After looking through one of my Visual C++.NET project files, it looks like Optimization through the Standard IDE is a no-show. Sorry to deliver the bad news.
Happy Programming and may God Bless!
"Your coding practices might be buggy, but your code is always right."
Internet::WWW::CodeProject::bneacetp
N-Tech Productions
http://www.n-tp.com/
|
|
|
|