|
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.
|
|
|
|
|
What function is this code in? My guess would be that myButton is going out of scope and being destroyed just after it's been created.
|
|
|
|
|
Thanks for your reply.Previously myButton is local variable in OnInitDialog function. I have changed it to member variable and I have allocated memory.It is working fine and it is displaying Radio Button.
I have changed this to Push Button. I need to add Event Handler to this Button.Can any one help me.
modified on Thursday, March 26, 2009 12:17 AM
|
|
|
|
|
you need to derive the new class from CButton and add the event handler in that class
|
|
|
|
|
I am in a loop, reading from an RS232 port. There are times when i receive an exception with a system message that says:
"The I/O operation has been aborted because of either a thread exit or an application request"
// read a byte from port
while (!m_bExit)
{
// reset flag variables
dwBytesRead = 0;
// read
bRC = ReadFile(m_hCommPort, pDataBuff, 20, &dwBytesRead, NULL);
dwError = GetLastError();
if (!bRC)
{
if (ERROR_HANDLE_EOF != dwError || ERROR_TIMEOUT != dwError)
{
LPVOID SysMsg;
// reterieve system message
FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
dwError,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR)&SysMsg,
0,
NULL );
// show system message
ZeroMemory( m_szBuffer, sizeof(m_szBuffer) );
wsprintf(m_szBuffer, TEXT("ReadRS232Data() over %s: ReadFile(), %s"), m_Port, (LPCTSTR)SysMsg);
LocalFree(SysMsg);
return 0;
}
}
Has anyone ever found a solution to this or know what would cause this error? Cause once this happens you cannot read from the port until it is out of this conditions which seems to just happen on its own.
Thanks in advance for any help or direction.
|
|
|
|
|
LCI wrote: I am in a loop
That sounds uncomfortable.
LCI wrote: or know what would cause this error
What is the number returned from GetLastError?
|
|
|
|