|
aei_totten wrote: But somethings you just can't beat in c++.
You can beat a fish.
led mike
|
|
|
|
|
Hello everyone!
I have built a digital table with a pencil (like a wacom) and I'm doing my own drivers.
He managed to move the mouse through the following simple code [Visual C + + in XP]:
INPUT aInput;
aInput.type = INPUT_MOUSE;
aInput.mi.dwFlags = MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE;
aInput.mi.dwExtraInfo = 0;
aInput.mi.mouseData = 0;
aInput.mi.time = 0;
aInput.mi.dx = (data.X * 65535.0f);
aInput.mi.dy = (data.Y * 65535.0f);
int aResult = SendInput(1, &aInput, sizeof(INPUT) );
But, I do not see how you can send to the system/software (Photoshop, paint ,...) data with the pressure of the pen to draw. I suppose that will be a standar, but nothing found information about it.
Someone known as is done? That object is used?
Thanks!!
|
|
|
|
|
motivinteractive wrote: But, I do not see how you can send to the system/software (Photoshop, paint ,...) data with the pressure of the pen to draw. I suppose that will be a standar,
I think you are looking for the Wintab specification for drivers.
http://www.smartcomputing.com/editorial/article.asp?article=articles/archive/r0403/06r03/06r03.asp&guid=[^]
Software. Without appropriate software support, no peripheral can communicate with the computer. In the case of digital tablets, this means each program must support the tablet with an API (Application Program Interface), and each tablet must include a software driver.
The application developer is responsible for implementing the AP correctly. Wintab is the most popular tablet API in use. Developers can add the Wintab API to their application and support almost any tablet on the market today. API's are often specific to a category, such as tablets, but are not device specific. (For more information, see "Programming Foundations" in this issue.)
Software drivers, on the other hand, are device specific. Each device has different features and speaks a slightly different language. Each driver is written for a specific tablet and translates the tablet's language into something Wintab can understand. This lets developers implement support for a wide range of tablets without having to write support for several different devices.
led mike
|
|
|
|
|
Hello all,
I want to change the bitmap for the mouseover, mouseup and mousedown events in the CBitmapbutton. Please guide me.
Kind regards,
Banu
|
|
|
|
|
Create event handlers and write your code in them.
led mike
|
|
|
|
|
Dear Mike,
I add the event handler but when I move mouse to the dialog the event is triggered but I need to trigger the mouse move event whenever I place the mouse over the bitmapbutton. Please advice.
Thanks and Regards.
|
|
|
|
|
I used the BCN_HOTITEMCHANGE but I dont know how to implement. Please advice.
|
|
|
|
|
I want to implement a timer in MFC application so that I can set the time of ten seconds .
so after every ten seconds it fires and i can process my code after every ten seconds
Ashish
|
|
|
|
|
SetTimer(NULL,10000,NULL);
Handle WM_TIMER in your Application
e.g.
void CTestDialogDlg::OnTimer(UINT nIDEvent)
{
AfxMessageBox("I m here") ;
CDialog::OnTimer(nIDEvent);
}
it Should work for You.
-@SuDhIrKuMaR@-
|
|
|
|
|
This page [^] has wonderful info about.
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 thought pipes could be used for that.
Oh wait - that's for inter-thread communication
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
RPC ?
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]
|
|
|
|
|
CPallini wrote: RPC?
naah i like WM_COPYDATA more!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
Look at this (it is not specifically for MFC).
However if you do not need a high precision timer (like multimedia ones), you can use SetTimer of CWnd and handle the event fired overriding the OnTimer virtual function (or handle the WM_TIMER explicitly).
|
|
|
|
|
Although many people do suggest using the CTimer class See Here)[^]
The SetTimer function and related message and functions are not intended to be precise. Certainly you need to at least use more precise timers. Note that, except for special versions of Windows, Windows is not designed for real-time processing. Don't expect an application program to be able to respond reliably to timer events.
I would suggest you to read this[^] before you implement anything
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Well, for a ten seconds timer, I suppose real-time system timing precision is not required.
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]
|
|
|
|
|
BTW and IMO it was not a bad piece of information (to be voted down to 1), Sometimes you really need accurate timers and many a times you may not. Things look weird when you come to know that your timer is not getting fired every ten seconds and you want it to behave like that and that too after spending a lot of time in debugging.
After all it was only a piece of advise.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
_AnShUmAn_ wrote: BTW and IMO it was not a bad piece of information
I agree: it is indeed a valuable piece of information. I simply added a common sense based observation.
_AnShUmAn_ wrote: to be voted down to 1
I've just balanced the troll's vote.
Cheers,
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]
|
|
|
|
|
CPallini wrote: I've just balanced the troll's vote.
I am in too!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
_AnShUmAn_ wrote: BTW and IMO it was not a bad piece of information (to be voted down to 1),
Not at all, let me square it of too.. the person who voted you down.. must be A** !
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
hi,
i want to ask a simple question related to my code here. I am using a MessageBox to show the user the estimated time of the battery. The start value is an ULONG which i put into my function as float seconds. The cond param is the returnstring of my function.
Is the conversion (because the wsprintf function does not understand the %f param for formatting) right ? And what could i improve ?
Thanks !
void gettimestring(float seconds,wchar_t *input)
{
float minutes,hours;
hours = floorf(seconds/3600);
seconds -= hours*3600;
minutes = floorf(seconds/60);
seconds -= minutes*60;
char buf[20];
sprintf(buf,"%02.0f:%02.0f:%02.0f",hours,minutes,seconds);
wsprintf(input,L"%S",buf);
}
bye,
gabbana
|
|
|
|
|
Try Win32 API "MultiByteToWideChar"
For example
int nSize = MultiByteToWideChar(CP_ACP,MB_PRECOMPOSED,buf,strlen(buf),input,sizeof(input));
input[nSize] = 0;
|
|
|
|
|
Okay thanks i will try it, i think i need first to look into the msdn what the params exactly mean.
|
|
|
|
|
Why are you using float s for such a thing?
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]
|
|
|
|
|
The calcucaltion of the hours have decimal numbers. So I think i need floats at minimum or what do you mean exactly ?
|
|
|
|