|
I'm using mouse wheel as user input in a CWnd. But when vertical scroll bars are on, I'm receiving OnVScroll() messages instead of OnMouseWheel() messages.
How can I ignore OnVScroll() messages, and always receive OnMouseWheel() as if the scrollers were not enabled?
Thanks
|
|
|
|
|
Jesper Knudsen wrote: But when vertical scroll bars are on, I'm receiving OnVScroll() messages instead of OnMouseWheel() messages.
Do you mean to say that, even if you are using mouse wheel for vertical scrolling, you are getting OnVScroll called ?
It should not.
Jesper Knudsen wrote: How can I ignore OnVScroll() messages, and always receive OnMouseWheel() as if the scrollers were not enabled?
I might have interpreted your question wrongly, but OnVScroll(WM_VSCROLL) will be called only when you use cursor to drag scrollbar. In case on mouse wheel it will not be called.
-- modified at 10:48 Monday 11th December, 2006
|
|
|
|
|
Well, I am infact not getting mouse wheel messages, only vscroll. That is, if the scroll bar is on. I think it depends on the mouse driver. Once I got two mice connected. One would send mouse wheel as expected, another would translate wheel messages to vscroll.
So I need to break in, where the mouse wheel comes in to reject cscroll messages on mouse wheel.
|
|
|
|
|
Hi
Can anyone point me in the right direction. I have a MFC application that I would like to profile. I have the right version of VC++ and have turned on all the profiling options according to the documentation as far as I can tell.
When I run the profiler I get the initial startup dialogs from my app but the main window never appears. Task manager shows that an app of the same name but with a ._ex extension is running. If I kill this process then the profiler complains that the .pbo file wasn't of the right format.
What am I doing wrong?
Many thanks for any guidance that can be provided.
Andrew Hoole
|
|
|
|
|
Profiled/instrumented application can take a LOT longer to run than even a debug version.
Is the process running or is it standing still ( 0% CPU ) ?
just to be certain, put a couple of output traces here and there in your code to let you know that the thing is running ok.
|
|
|
|
|
It is standing still on 0% CPU. I have left it for quite a while without seeing anything happen.
Andrew Hoole
|
|
|
|
|
If you disable profiling, does it run as normal?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Dear all,
I changed tab style to display vertically at the rightside of the property page using TCS_RIGHT. But it is not visible first time the dialog appears and when i click any of the tab in the group ,all the tabs will appears.
The problem is the text in the tab control is still displaying in horizontal style
Regards
Manjunath S
Manjunath S
GESL
Bangalore
|
|
|
|
|
Are you using common controls version 6? If so, then the tab control no longer supports the left/right styles.
|
|
|
|
|
Michael Dunn wrote: ...common controls version 6? If so, then the tab control no longer supports the left/right styles.
Really? Is this because of the "This style is not supported if you use visual styles"
restriction?
|
|
|
|
|
Yes, that's what "This style is not supported if you use visual styles" means - that style bit gets ignored when you use common controls v6.
|
|
|
|
|
Never mind - I see it under TCS_BOTTOM, which is the first place I'd look if I wanted
tabs on the right
Thanks for the heads-up!
|
|
|
|
|
Hi all,
I'm looking for a more intellegent way to get data from a file and manage that data. For instance lets say i have a file with the following data in it:
[Category A]
filename = file1.txt
fileExtension = txt
[Category B]
ipAddress = 192.168.0.1
portNumber = 101
So how can I access only the parts within the file that is useful?? , without hardcoding anything.
Many Thanx
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
What about using XML ?
Another solution would be to use a class that parses INI files (that is, files that have the same structure as your). I think there are some such classes on this website.
|
|
|
|
|
Thank you Cedric...
"....I think there are some such classes on this website....." you mean on code project?
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Programm3r wrote: "....I think there are some such classes on this website....." you mean on code project?
Yes of course. Take a look here[^] for example (there are some other, just do a search in the articles in the MFC/C++ category).
|
|
|
|
|
Many thanx Cedric .... I appriciate the help
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Programm3r wrote: [Category A]
filename = file1.txt
fileExtension = txt
[Category B]
ipAddress = 192.168.0.1
portNumber = 101
So how can I access only the parts within the file that is useful??
This is the format of a .ini file. Use functions like GetPrivateProfileString() .
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hello
on visual c++ 6
my pb is:
when I create a std::map in an exe and pass it to a object's method in a DLL, I can't access to the elements of the map (it crashs after the first access).
You can try this minimal code illustrating that.
the code: a main.cpp file: the "application".
dll.h and dll.cpp : the dll with the object's method:
main.cpp___________________________
#pragma warning( disable: 4786 )<br />
<br />
#include <map><br />
#include <iostream><br />
#include <string><br />
#include "dll.h"<br />
<br />
int main ()<br />
{<br />
std::map<const std::string, std::string> l_map;<br />
std::map<const std::string, std::string>::iterator it;<br />
int i;<br />
<br />
l_map["1"] = "2";<br />
l_map["3"] = "4";<br />
l_map["5"] = "6";<br />
<br />
for (it = l_map.begin(); it != l_map.end(); it++)<br />
{<br />
std::cout << (*it).first << ": " << (*it).second << "\n";<br />
}<br />
<br />
CDll obj;<br />
obj.f(l_map);<br />
<br />
std::cin >> i;<br />
return 0;<br />
}
dll.h________________________________________
#pragma warning( disable: 4786 )<br />
<br />
#include <map><br />
#include <iostream><br />
#include <string><br />
<br />
#ifdef DLL_EXPORTS<br />
#define DLL_API __declspec(dllexport)<br />
#else<br />
#define DLL_API __declspec(dllimport)<br />
#endif<br />
<br />
class DLL_API CDll<br />
{<br />
public:<br />
void f(std::map<const std::string, std::string>& p_map);<br />
};<br />
dll.cpp________________________
<br />
#include "dll.h"<br />
<br />
void CDll::f(std::map<const std::string, std::string>& p_map)<br />
{<br />
std::map<const std::string, std::string>::iterator it;<br />
<br />
for (it = p_map.begin(); it != p_map.end(); it++)<br />
{<br />
std::cout << "DLL: " <<(*it).first << ": " << (*it).second << "\n";<br />
}<br />
}<br />
Thank you in advance for your help.
Nico
|
|
|
|
|
Are both the DLL and the exe using the same runtime library ? You can check in your project setting -> C/C++ -> Code Generation -> Runtime library (for VC2005)
|
|
|
|
|
Oh ! you are here, too.
I tried to reproduce crash. But, no success.
May be problem is what Cedric is saying.
|
|
|
|
|
This is a known problem in the STL that comes with VC++6.0. See KB articles Q172396 and Q168958 for more details. In a nutshell, this has to do with how that STL implementation uses static data.
There are alternate STL implementations (like Dinkumware) that do not have this problem. At least, I think the old Dinkumware one you used to be able to purchase.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Both Cedric and James are right. There are two problems with your approach:
1) The version of STL you are using is broken. You can try fixes available here[^]: or pick some other implementation of the Standard Library that works with VC6.
2) Even when you get a good STL implementation, you'd better ensure that all the modules use the same instance of the CRT.
In short, I think it is a good idea to follow Herb Sutter's advice and make the dll entries C (not C++) functions.
|
|
|
|
|
Nemanja Trifunovic wrote: In short, I think it is a good idea to follow Herb Sutter's advice and make the dll entries C (not C++) functions.
I don't recall ever seeing Sutter saying that. Do you have a reference for it?
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|