|
Hello,
I am trying to make this work for over 1 week now, and no luck.
I made the modifications you sayed + more.
I made the source compile to exe (console) so I can keep track of the data.
I attached a window to the console, and whenever I move the mouse/click in the window, the console prints what is happening.
The problem is that when I connect the touchscreen, and use RIM_TYPEHID , it does nothing.
I set a simpel cout<<"AA"; whenever it gets in the if RIM_TYPEHID branch, but it never does.
Any suggestions ? help ?
I also noticed that the riRawInput.data.mouse.lLastX; (and Y) for the mouse are always values that change to 0, so they are showing the motion of the mouse.
When I touch the touchscreen, the values go up to 5 000.
I don't know what to say ... I just need the touchx/y absolute position (or relative).
I hope someone can help.
Thanx
|
|
|
|
|
I managed to make it work.
I didn't have to make ANY Changes (add a new raw device).
The check :
riRawInput.data.mouse.usFlags == MOUSE_MOVE_RELATIVE is for mouse
and the check
riRawInput.data.mouse.usFlags == 3 is for touch screen.
After getting this, you will have to calibrate the device, and all will be perfect :
1. Prompt the user to touch the upper left corner of the video screen.
2. Save the coordinates returned as TOUCH_UL_X and
TOUCH_UL_Y.
3. Prompt the user to touch the lower right corner of the video screen.
4. Save the coordinates returned as TOUCH_LR_X and
TOUCH_LR_Y.
A good way to prompt the user to touch the corners is to draw a
border around the edge of the screen and prompt the user to touch
each point using a target in the respective corner and text centered
on the screen.
5. Calculate the four calibration parameters as follows:
OFFSET_X = TOUCH_UL_X
OFFSET_Y = TOUCH_UL_Y
SCALE_X = VIDEO_MAX_X / (TOUCH_LR_X -
TOUCH_UL_X)
SCALE_Y = VIDEO_MAX_Y / (TOUCH_LR_Y -
TOUCH_UL_Y)
6. Save the four calibration parameters to a nonvolatile storage area, if
available. If none is available, the calibration procedure must be
followed each time the system is powered up.
The floating point calibration procedure is now complete. In your
application program, convert the touch coordinates reported by the
touch system into the equivalent video coordinates with these equations:
VIDEO_X = SCALE_X * (TOUCH_X - OFFSET_X)
VIDEO_Y = SCALE_Y * (TOUCH_Y - OFFSET_Y)
|
|
|
|
|
Does ayone who frequents this page use the Digital Mars C++ compiler for Win32 development?
I've recently got a freebie copy of it and had a go at compiling some existing code. So far so good but the Win32 headers it ship with seem to be way behind. I need SDK 6.1 compatibility which is clearly going to be tricky.
Their site doesn't seem to be very up to date, forums are dead for the past few months and most online docs look seriously old.
Is DMC still really a live product? Is it worth me shelling out for the full version on CD? Or has MS giving away express versions of Visual Studio killed off this alternative compiler?
Any ideas as to where else to go for some answers are welcome too.
"The secret of happiness is freedom, and the secret of freedom, courage."
Thucydides (B.C. 460-400)
|
|
|
|
|
I am trying to port a console chat server program to mfc
from the articles
when I declare
///////////////////////
SOCKET m_SClient;
SOCKET m_SListenClient; // socket listening for client calls
/////////////////////
I get the following, am i missing an include
unresolved external symbol __imp__listen@8
symbol __imp__bind@12
d external symbol __imp__socket@12
unresolved external symbol __imp__htons@4
unresolved external symbol __imp__WSAStartup@8
unresolved external symbol __imp__accept@12
unresolved external symbol __imp__send@16
unresolved external symbol __imp__recv@16
LNK1120: 8 unresolved externals
|
|
|
|
|
As stated by the documentation (see, for instance, [^]), you must link with ws2_32.lib library.
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]
|
|
|
|
|
|
|
here is the following statement,
//////////////////////////////////
list<SOCKET> m_vClientList; // All sockets connected to client
//////////////////////////////////
I have included the #include <list>
the program in question, is an internet chat, one server to many
clients
also a declartion in the header file
/////////////////////
int SendMessagePort(string sMessage);
//////////
has a problem with (string) I know that mfc deals with CString
but in this case it might help with my query.
I gather that I need an ---#include of somesort, do you know what it is.
thanks very much
modified on Saturday, October 4, 2008 12:38 PM
|
|
|
|
|
You've to include <list></list> , <string></string> and add the using namespace std; directive. For instance
#include <list>
#include <string>
using namespace std;
</string></list>
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
please tell me how can i convert Convert CString[] to char[].
CString str[10];
char buff_1[]="";
buff_1= str;
error is "error C2440: '=' : cannot convert from 'CString [10]' to 'char [1]'"
Thanks 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
|
|
|
|
|
you should define buff_1 as char*:
char * buff_1;
and then:
buff_1 = (LPCTSTR)str; // for read-only purposes
buff_1 = str.GetBuffer(0); // for read-write, you will need to use ReleaseBuffer() later
Best regards,
Jaime.
|
|
|
|
|
They're two quite different entities:
(1) CString str[] is an array of strings.
(2) char buff[] is just 1 string.
hence the conversion does not make sense.
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]
|
|
|
|
|
"_$h@nky_" wrote: CString str[10];
I'm guessing thia is not what you think it is. It's an array of 10 CString objects, not an array that holds 10 characters. In any case, try:
const char *buff_1 = str[0];
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
hai,
i would like to display the coding.
Means, while i m running my C/C++ program the output should be of the program coding which i m execting.....
how can i do it? Help me!
Thanks for understanding!!!
|
|
|
|
|
You need to (A) debug a debugger or (B) dissasemble/decompile a dissasembler/decompiler
Then, the program running would be doing nothing other than producing output that contained the program's source-code
I don't understand your question, as it stands. The effort would be pointless - an act of 'because I can'
|
|
|
|
|
Thanks for immediate reeply
for example...
my program coding is..
#include<stdio.h>
#include<conio.h>
void main()
{
float n1,n2,ans;
}</conio.h></stdio.h>
And the program output should be....
#include<stdio.h>
#include<conio.h>
void main()
{
float n1,n2,ans;
}
how to achieve it?
thanks in advance
|
|
|
|
|
Ahhhh....
I was afraid you were going to say that or words to that effect.
What you're looking for is a decompiler or a dissasembler. The difference is in the 'high-level'ness of their output. A dissasembler will turn a piece of executable code into an assembly listing. A decompiler on the other hand, will produce C (or most any other high level language within reason) code from an executable.
While it is true that a fairly large number of people have written dissasemblers, the same
can't be said for decompilers. It is a notoriously difficult & complex subject.
HexRays has a product that will turn an exe file into C source code - it is the $2000 plugin for IDA Pro interactive dissasembler.
You can find more info on HexRays here (they have a free version of IDAPro)
http://www.hex-rays.com/products.shtml[^]
Also, here are some links to decompilers/dissasemblers that people have coded themselves:
http://www.woodmann.com/collaborative/tools/index.php/Category:Decompilers[^]
http://www.woodmann.com/collaborative/tools/index.php/Category:Disassemblers[^]
'luck.
|
|
|
|
|
thanks for your reply.
whether this can be achieve in .net easily? or someother language?
|
|
|
|
|
Pleasure.
In every case I can immediately think of, these tools are compiled to native code. This of course implies the use of C/C++, asm & pascal though I've no idea if anything .NET would be suitable or not - I would assume it to be possible, albeit slow in execution on account of the code being interpreted at runtime.
Lutz Roeder's .NET Reflector will give you the source code of a .NET executable. The Deblector & Reflexil plugins are invaluable - HOWEVER these are all only available as binaries, so of very little to no interest to somebody trying to create a tool that achieves the same task.
|
|
|
|
|
ah... this much complicated is there??? since this question was raised by my professor. He ask to find the answer and the coding for this.
|
|
|
|
|
The program that reproduces its own source as output is called quine (After American logician Willard Van Orman Quine). There are many ways to do it, but rather than I give you a complete working example, I'd appreciate if you google for quine and go through the results.
It's better to know some of the questions than all of the answers.
Pravin.
|
|
|
|
|
Hi,
Can I Use Visual Studio Express Edition 2008 for developing Commercial Application?
Thanks Saurabh For information, just need to confirm with the forum.
Thnaks everyone
Karmendra
|
|
|
|
|
Yes: see http://www.microsoft.com/express/support/faq/[^], question 7 .
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..
Can i fill my Moving dialog, Bubble Dialog with gradient color???
Can someone throw light on that??
Thanks..
|
|
|
|