|
Hi all,
I am new to the concepts on vc++, in my application i want to get the external hid device name connected to the system.
can anybody suggest me the right approach for doing this???
|
|
|
|
|
Hi,
I made a simple SDI application with only 2 events. The OnMouseMove
and onLButtonDown. Either of these I wrote a simple TRACE output of their
XY coordinates as shown bellow :
CString str;
str.Format("onMouseMove X=%d Y=%d \n",point.x,point.y);
TRACE (str);
The strange thing is that, some times and not everytime, when I press the left mouse button (without any movement - I checked this many times) at a specific XY coordinates let's say at 100,100 the mouse get slightly moved 1 pixel to the right or to the left ie 99,100. So the onLButtonDown reports a different XY from that is supposed to be.
I know that someone can say that I might move the mouse cursor without knowing but that's not true. I checked this many times and I found it very annoying since I use this for checking 1-pixel thumb nails.
Is there any recommendation? I use VC9 and SDI. I did not tested this with VS6 or older version.
Regards,
George
sdancer75
|
|
|
|
|
The last coordinates you get in a mouse move message aren't
necessarily going to be the same as the coordinates when you
stop moving the cursor.
You should use GetCursorPos to get the current position, not rely
on the coordinates from WM_MOUSEMOVE.
sdancer75 wrote: 1-pixel thumb nails.
Really?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks Mark for you help.
I know that 1 pixel thumb-nail sounds extreme and I will try to make it up
but is used in a timeline control where 1 pixel corresponds to 1 second and a slice
might have only 1 second duration which as I already said coresponds to 1 pixel width.
Anyway, you suggest that I should ingore the XY coordinates I get from the WM_MOUSEMOVE
and check all over the time the GetCursorPos either on MouseMove or LButtonDown events? Is that a slow method?
I did not find anything related to this in the MSDN. I suppose you have right, but I can not understand why the XY-coords
are given from the above events, if they are unreliable.
Best Regards,
George
sdancer75
|
|
|
|
|
sdancer75 wrote: I can not understand why the XY-coords
are given from the above events, if they are unreliable.
They're reliable but they reflect the cursor position at the
time the message is created and dispatched. Since there's no
WM_MOUSESTOP message, it's not always possible to get the actual
current cursor position from the last received WM_MOUSEMOVE
message.
sdancer75 wrote: check all over the time the GetCursorPos either on MouseMove or LButtonDown events? Is that a slow method?
I personally use GetCursorPos() in all my mouse message handlers.
The mouse is a relatively slow device, so the time it takes to
call GetCursorPos() is insignificant.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thank you very much Mark,
You saved me from a many hours trying to find what's going worng here.
I thought that it was my bug and I have already spend about 3 days of work trying to fix this, before I ask for help to this forum.
Take care,
Greece
sdancer75
|
|
|
|
|
Hi
Is there any C++ project or toolkit for solving math equations?
or a good article?
www.logicsims.ir
|
|
|
|
|
There's Google , a powerfult toolkit for answering such a question [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
sounds like someone's having trouble with their homework
|
|
|
|
|
Indeed.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I once knew how to do this but not now, can someone put me in right direction...
Putting "Bold Headings" on dialog box without using static text.
it was somthing like setting text property and write text on dialog box using X,Y position.
pls help
Gpat
|
|
|
|
|
if you don't want to use a STATIC control then you have to handle the WM_PAINT message and write the text (possibly using TextOut ) in your message handler.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi all,
i want to use plugins for disigning of buttons in MFC application.
anybody can give me any suggestions or example for this.
thank in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
"_$h@nky_" wrote: i want to use plugins for disigning of buttons in MFC application.
Which plug in you want to use?? What exactly you doing ?
See this Section on CP Button Control[^] May be after this you wont need to use any plug in..
Regards,
Sandip.
|
|
|
|
|
Do you want to have a cutomize button?
|
|
|
|
|
yes
i want to button which is looks like vista when appliocation runs on Vista and looks like xp if it runs on XP
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
|
thanks
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
|
its our company site
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Those programs are trial or full for download?
|
|
|
|
|
demo's are trial Full version sholud buy from site
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Thanks for info.
|
|
|
|
|
Hi,
I am getting a compilation error while using ConvertStringSecurityDescriptorToSecurityDescriptor ( ). I have included Sddl.h , Have AdvApi32.dll and AdvApi32.lib at correct places. But still getting a compilation error as undeclared identifier.
Thanks....
|
|
|
|
|
MyView wrote: I have included Sddl.h , Have AdvApi32.dll and AdvApi32.lib at correct places. But still getting a compilation error as undeclared identifier.
That is surprising??
What platform you are using??
Regards,
Sandip.
|
|
|
|