|
Hello,
I am making an application which requires some form of real time incoporated with multithreading. It need to be exact to less than 1 ms. What is the best method to get this kind of precision timing ?
|
|
|
|
|
BeakX wrote: What is the best method to get this kind of precision timing ?
using another OS than Windows first !!!
because Windows is not a RT OS, you cannot have timer accuracy under the millisecond...
|
|
|
|
|
If you are running on Windows operating system, the answer is simple: you can't. Windows is not a real time application and if you need resolution under 10 msec (can change a lot depending of the computer, the load of the CPU, ...) you cannot do that on windows. Better try to look for a real-time operating system. I don't know a lot, I worked already with eCos[^] but it will take some time to get ready with it.
|
|
|
|
|
Any API present to copy the content of a command prompt running in the machine
to text file?
Any other DOS command is available to store the content of command prompt in to the text file or a buffer?
Any other way is present to copy the content of a running command prompt in to the text file?
Kumar
|
|
|
|
|
|
void foo(TCHAR** t)
{
size_t tt = sizeof(*t);
}
int _tmain(int argc, _TCHAR* argv[])
{
TCHAR szForRequestData[] = TEXT("ForRequestVar");
foo(&szForRequestData);
return 0;
}
foo expected to receive a pointer to a pointer variable of type TCHAR, and it was feeded with pointer variable's address by
foo(&szForRequestData);
why the compiler complaining about "cannot convert...", I can't see where's wrong!
|
|
|
|
|
& and * are opposites (or you can look at it that way)
you have 1 & which will lift 1 * and that will leave you with 1 *.
Try defining your foo function like this:
<br />
void foo(TCHAR* t){<br />
}<br />
Coulda, woulda, shoulda doesn't matter if you don't.
|
|
|
|
|
V. wrote: Try defining your foo function like this:
void foo(TCHAR* t){
//Do stuff here
}
Thanks, but I want foo to be a function that accept a pointer to a pointer variable. But in you case I believe it was a pointer to TCHAR.
-- modified at 4:42 Wednesday 5th April, 2006
|
|
|
|
|
LiYS wrote: "cannot convert...",
cannot convert....//what.
Please give full error message.
Nibu thomas
Software Developer
|
|
|
|
|
Nibu thomas wrote: Please give full error message.
t.cpp(16): error C2664: 'foo' : cannot convert parameter 1 from 'TCHAR (*__w64 )[14]' to 'TCHAR ** '
-- modified at 4:40 Wednesday 5th April, 2006
|
|
|
|
|
Try this...
void foo(TCHAR** t)
{
size_t tt = sizeof(*t);
}
int _tmain(int argc, _TCHAR* argv[])
{
TCHAR* szForRequestData = TEXT("ForRequestVar");
foo(&szForRequestData);
return 0;
}
Nibu thomas
Software Developer
|
|
|
|
|
It passed compilation, but the questions boil down to:
1.what's the difference between
TCHAR* szForRequestData = TEXT("ForRequestVar");
TCHAR szForRequestData[] = TEXT("ForRequestVar");
|
|
|
|
|
in the second case (empty []) it creates an array which size is fixed by the assigned value...
|
|
|
|
|
LiYS wrote: TCHAR* szForRequestData = TEXT("ForRequestVar");
in this case the starting address of the string is stored in the TCHAR* szForRequestData
LiYS wrote: TCHAR szForRequestData[] = TEXT("ForRequestVar");
in this case the starting address of the string is represented/indicated by szForRequestData
never say die
-- modified at 6:24 Wednesday 5th April, 2006
|
|
|
|
|
See here.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Because the built-in conversion from "array of X" to "pointer to X" only applies to one-dimensional arrays. You're expecting that conversion to apply everywhere, which it doesn't. "pointer to array of X" doesn't convert to "pointer to pointer to X"
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
I tried to compile a simple unicode DLL, in both Release and Debug mode. This DLL, when called will show a message box with some unicode text. The Debug mode DLL works very fine. The release mode DLL is crashing after I call it the first time. I do not understand this. What exactly should I do to make the Release mode DLL work fine? I have read Joseph M. Newcomers essay about Release Vs debug. I did not find my answer in that. I am not using any variables any structures, etc.
Regards,
Aljechin Alexander
|
|
|
|
|
The answer is probably in the essay you 've already read! You provide very little information to anyone be able to give you an aswer. Try to figure out at what line of code the dll crashes. The most probable reason for the crash is an uninitialized variable.
|
|
|
|
|
Sir , I want to Know Why DataBase Application is giving a Error As CRecordSet Base Calss Undefined? and how can i fix it.
What i did is as follows
1)I have Taken a SDI App with its Views BaseClass as CFormView.
2)Derived new Class From CRecordSet named CStuRecSet and Selected Corresponding Data Source.
3) and Later I Declared and Object of m_StuRecSet of type CStuRecSet in Document Class.
sir pls tell how to clear this error(CRecordSet Base Class Undeclared)
Fly Like An Eagle With MIGHTY POWER.
|
|
|
|
|
satishvarma_e wrote: sir pls tell how to clear this error(CRecordSet Base Class Undeclared)
Because you haven't included afxdb.h .
Nibu thomas
Software Developer
|
|
|
|
|
Hi,
I am trying to have two views on file new on the same document and initiate windows tile command. I put the following code in the CChkBookApp::initinstance function at the bottom after all templates and window is created. But I get error. How to solve this. Thanks lee
CChkBookDoc* pDoc = (CChkBookDoc*)pMainFrame->GetActiveDocument();
if (pDoc == NULL)
return NULL;
CFrameWnd* pNewFrame = m_pCheckViewTemplate->CreateNewFrame(pDoc, NULL);
if (pNewFrame == NULL)
return pDoc;
m_pCheckViewTemplate->InitialUpdateFrame(pNewFrame, pDoc);
// Tile the two MDI children windows within the MDI frame window.
ASSERT_KINDOF(CMDIChildWnd, pNewFrame);
CMDIFrameWnd* pMDIFrameWnd = ((CMDIChildWnd*)pNewFrame)->GetMDIFrame();
ASSERT(pMDIFrameWnd != NULL);
pMDIFrameWnd->MDITile(MDITILE_HORIZONTAL);
|
|
|
|
|
yang__lee wrote: But I get error.
What is the error!
Nibu thomas
Software Developer
|
|
|
|
|
If the error comes when you create the new view then
the code that you can find in
CMDIFrameWnd::OnWindowNew()
is a good example to open correctly a window on a MDI application.
The tile operations looks ok.
Have a nice code day
|
|
|
|
|
I am a beginner of MFC.
this time i want to use MFC wizzard with MDI.
I add
cs.style |=WS_MAXIMIZE;
cs.style &= ~(WS_MINIMIZEBOX| WS_MAXIMIZEBOX )
in CChildFrame::PreCreateWindow()to create childframes maxmized when they are created.and disable the MINIMIZEBOX and MAXIMIZEBOX .
when child frame is created,it did show with maxmized;
I clicked the minmize button at the system menu(not in childframe title),it doesn't work(&~WS_MINIMIZEBOX),
the problem is:when i clicked the maxmize button at system menu,child frame resized and placed to the full client of the Mainframe.
and there is no minmize and maxmize button on the title of child frame.
That's why? i had added the "&~WS_MAXIMIZEBOX ".
Who can help me .
I will appreciate much!
bruspark
-- modified at 1:23 Wednesday 5th April, 2006
|
|
|
|
|
Can you be more specific as to what you wish to do.
Nibu thomas
Software Developer
|
|
|
|