|
I have a COM port open as a host (ie: COM3, 9600 baud, 8 bit, 1 stop) & receive stream data continously from another PC Serial interface (as client), the data represent as a standard Mouse protocol including 3 bytes:
1st byte 2nd byte 3rd byte
----------------- ----------------- -----------------
|-|1|?|?|X|X|Y|Y| |-|0|X|X|X|X|X|X| |-|0|Y|Y|Y|Y|Y|Y|
----------------- ----------------- -----------------
| | \ / \ / | |
| | | | | |
| | | ------------- ---------- |
| | ---------- | \ \ |
| | \_\_ _ _ _ _ _ _ \_\_ _ _ _ _ _ _
| | |_|_|_|_|_|_|_|_| |_|_|_|_|_|_|_|_|
| | X increment Y increment
Left Button -- |
Right Button ----
I would like to build a driver for this so that I can use these data as a Mouse device on my PC. I am am able to retrive data through COM port with VC++ 6.0, but I have never done this for creating as a driver before, can someone help me?
Thanks in-advanced for any help
modified on Wednesday, March 25, 2009 1:59 PM
|
|
|
|
|
I am writing some (rtf format)text in CRichEditView by using GetRichEditCtrl().
When clicking on the text I want to get the notification.
Where I can get WM_LBUTTONDOWN message, the notification function is not called when clicking the text.
How to get the notification?
Any suggestion would be greatly appreciable..
--
"Programming is an art that fights back!"
|
|
|
|
|
Look for the documentation for EN_SELCHANGE. That is sent if you ask for it (read the page for details), and then you get notified when the selection changes.
That was you handle the user clicking in different places, and update external stuff if you so wish.
If you just want to know when your view is clicked on to wake it up, you can make a new view vlass inheriting from CRichEditView and handle override CView::OnActivateView.
Good luck,
Iain.
In the process of moving to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job!
|
|
|
|
|
Hi anybody any experience with writing plug-ins for winamp?? i have downloaded winamp.h and winamp.cpp but i'm at a loss at how to use them, the install instructions are very brief, can't seem to figure out what to do??
It comes with an example but when i try to compile it, it gives warnings in the winamp.cpp file? ....can anybody help share light on this as i'm really stuck
|
|
|
|
|
The Compuware website isn't helping me so I'll try here before I go home.
I have a lot of C++, and I prove how nicely I have tested it by running DevPartner Coverage. Easy.
Now it has decided to analyse the Microsoft standard libs too. I turned off all the other Microsoft stuff, in fact in was turned off by default anyway. I tried all the obvious things in Help.
And still I get hundreds of lines of this (as code not tested; of course I didn't test it!):
std::<debugheapallocator><char>::allocate...
std::<debugheapdelete><class>...
Looks like the standard lib to me.
Has anybody here had this problem? Has anyone a suggestion not mentioned in Help?
-------------
Bibo ergo sum
|
|
|
|
|
It took 10 minutes for me to understand your problem partially. There should be a way to ignore them. I've used Rational Coverage. We remove these libs from the result. Is there anyway in your tool? Did you search for it?
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
Ah, the helpful website cut out most of the messages because of strange characters.
There are several ways to remove things from the list, and I have tried all of them, quite successfully, with all my included dlls and exes, with the exception of these std libs.
Maybe there is a way to remove these results from the end result. It is very irritating, because my code is safety critical and I am supposed to be over 95% coverage, and this glitch pushes me down to 60% of code and 40% of methods.
Here is just one of those messages:
std:: (underline) DebugHeapAllocator (pointed bracket open) char (pointed bracket close) deallocate::deallocate(unsigned int)
-------------
Bibo ergo sum
modified on Thursday, March 26, 2009 3:26 AM
|
|
|
|
|
I would like to measure the start and stop time of an external event. I would like to get the best time resolution I can using a laptop computer. What is the best time resolutions available using Windows and C/C++. Is the resolution in milliseconds, microseconds, or nanoseconds? What would be a good way to get a signal into the laptop. We are thinking about having an external signal that could either be on or off like a switch, and we would like to make a precise measure how long that signal is turned on.
Thanks, any help would be greatly appreciated.
|
|
|
|
|
Member 236262 wrote: Is the resolution in milliseconds, microseconds, or nanoseconds?
The best you will be able to get on a Windows PC is around 15 msec, because Windows is not a real-time operating system. So, if you need resolution lower than 15 msec, you should use a real-time operating system.
|
|
|
|
|
I think this[^] can give better results than 15 msecs.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Yes, but what about the scheduler? I mean, if the thread waiting for the event looses the CPU, what would be the precision?
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]
|
|
|
|
|
Good point.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
If the external event uses an interrupt on the PC, the scheduler is irrelevant.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
And how does the interrupt awake your user space thread?
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]
|
|
|
|
|
You retrieve the CPU performance counter in the ISR and write the time to file or through a shared memory queue or something of the like.
It should also be pointed out that waking a thread is usually done on less than a thread quanta. However, without a real-time kernel extension, even if your thread is highest priority, this signaling is not deterministic. But, as I said, if you store the actually counters in the ISR, this isn't an issue.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
So you've to write some kernel mode code or am I wrong?
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]
|
|
|
|
|
Yes.
Or you get a real-time extension for XP (like RTX from http://www.intervalzero.com/[^])
(I've never needed this degree of precision in XP, but if I did, I'd be inclined to use a micro-controller and something like eCOS on it to do the timings and then send the results to XP via serial port.)
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Joe Woodbury wrote: I've never needed this degree of precision in XP, but if I did, I'd be inclined to use a micro-controller
The same I would do.
Thank you for enlightening.
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]
|
|
|
|
|
Get an IO card which provides events or callbacks via a library when a given input changes state. One I used called NextMove (overkill for your needs) had the first 3 or 4 inputs using interrupts. Try Amplicon (I think) or similar for an IO card.
|
|
|
|
|
Dear All
// Fetches the MAC address and prints it
static void GetMACaddress(void)
{
IP_ADAPTER_INFO AdapterInfo[16]; // Allocate information
// for up to 16 NICs
DWORD dwBufLen = sizeof(AdapterInfo); // Save memory size of buffer
DWORD dwStatus = GetAdaptersInfo( // Call GetAdapterInfo
AdapterInfo, // [out] buffer to receive data
&dwBufLen); // [in] size of receive data buffer
assert(dwStatus == ERROR_SUCCESS); // Verify return value is
// valid, no buffer overflow
PIP_ADAPTER_INFO pAdapterInfo = AdapterInfo; // Contains pointer to
// current adapter info
do {
PrintMACaddress(pAdapterInfo->Address); // Print MAC address
pAdapterInfo = pAdapterInfo->Next; // Progress through
// linked list
}
while(pAdapterInfo); // Terminate if last adapter
}
can anybody just walk through my code and here i am staticaly allocting the memory for the storing the adpater information for upto 16 NIC card...
but if i want to get and enumerate all the MAC addresses on my PC...
the above code will give upto 16 card so what to do next...
plz help me....
Regards
sunny
|
|
|
|
|
|
Hey
ya it will generate link list...but my problem is how to allocate memory if more than 16 cards in the system.......
Regards
Sunny
|
|
|
|
|
Don't hard code the 16. From the link I gave you:
pOutBufLen [in, out]
A pointer to a ULONG variable that specifies the size of the buffer pointed to by the pAdapterInfo parameter. If this size is insufficient to hold the adapter information, GetAdaptersInfo fills in this variable with the required size, and returns an error code of ERROR_BUFFER_OVERFLOW.
Take a look at the sample code in the link and see how they do it.
|
|
|
|
|
Hi,
I have written following code in my MFC code to display Radio Button on my dialog.
CButton myButton;
myButton.Create(_T("My button"), WS_CHILD|WS_VISIBLE|BS_RADIOBUTTON,
CRect(50,40,80,70),this, 1);
But Dialog is not showing Radio button.Can anyone help me.
|
|
|
|
|
There are a number of things that could be the reason. Definitively know from your post we cannot.
My advice is that you learn how rendering is done in Windows OS which will enable you to determine your specific problem.
|
|
|
|