|
Russell' wrote: A simple solution I found is to start in the main-thread a loop that do a simple Sleep (for some ms) and then checks some flags that the worker-threads sets when ending. When it understand that all the threads are end it make some computations and start all again.
There are several MFC synchronization classes just for this.
Anytime you have to use Sleep() to get the desired result, it is most likely a bad design.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
i have wirtten a demo, which i want to chip the big file into the small ones by Memory-Mapped Files.
the main code:
HANDLE hFile = CreateFile(filePathName, GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
HANDLE hFileMap = CreateFileMapping(hFile, NULL, PAGE_READWRITE, 0, 0, NULL);
pvFile = MapViewOfFile(hFileMap, FILE_MAP_READ, 0, 0, dwCurPart);
HANDLE hNewFile = CreateFile(fileName, GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
HANDLE hNewFileMap = CreateFileMapping(hFile, NULL, PAGE_READWRITE, 0, dwCurPart, NULL);
PVOID pvNewFile = MapViewOfFile(hNewFileMap, FILE_MAP_WRITE, 0, 0, 0);
memcpy(pvNewFile, pvFile, dwCurPart);
i can get the new files,but the file don't get any content.i think the "memcpy();" can let the content
copy into the new files. thanks for your help.
|
|
|
|
|
You have set the dwNumberOfBytesToMap parameter for the destination file to 0.
Memory mapped files cannot grow like a disk files.
You have to create the destination file with blanks and set the dwNumberOfBytesToMap to the desired number of bytes.
To create a blank file use SetEndOfFile after the CreateFile call.
|
|
|
|
|
Hi,
I have created an MSI setup using VS2008 Setup project. It is installing properly but at last screen which shows "Installation Complete" I have a checkbox "Launch Now". It launches exe. But anyhow it is not launching in Vista or Win7. It is launching in XP.
Any suggestion ??
Thanks,
Rahul Kulshreshtha
|
|
|
|
|
rahul.kulshreshtha wrote: It launches exe. But anyhow it is not launching in Vista or Win7. It is launching in XP.
any security issues?
"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
|
|
|
|
|
that is what I am also thinking. I think setup is running as normal process (it sometimes asks for "yes" or "no") but it is not able to run the exe.
|
|
|
|
|
Did you start the installation through the setup.exe that gets bundled with the installer or did you just click on the MSI? Vista and Windows 7 run programs called setup.exe with more privileges than msiexec* so that might be your problem.
Cheers,
Ash
*Not the whole story but near enough to generate a couple of WTF??s
|
|
|
|
|
I was running it through MSI, but just now I also tried with setup.exe but nothing worked. Does any one know how can my Finish page has a checkbox for Launch now. I think it is not available by default and I could not find it on Finish page inside "View->User Interface" but orca shows it but I don't know which commands it tries to fire to Launch Exe. If I found that place then I might have some clue to solve it.
|
|
|
|
|
|
Hi,
Can any body help me.
Why my ListCtrl is not displaying values for certain
columns.
I have 10 columns out of these only column 3 is not displaying the values.
I am using the SetItemText() api
Can any body help me.
|
|
|
|
|
Could you please post the relevant code?
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]
|
|
|
|
|
try{
while( !m_pFrame->m_DbMgr.m_Rs.IsEof() )
{
//--- LRU Index -----------
m_pFrame->m_DbMgr.m_Rs.GetFieldValue( "LruIndex", nLruIndex );
strTemp.Format( "%d", nLruIndex );
m_pFrame->m_nLruIndex = nLruIndex;
m_ListInfoCtrl.InsertItem( nLruIndex-1, strTemp );
//---- LRU Name ------------
m_pFrame->m_DbMgr.m_Rs.GetFieldValue( "LruName", strLruName );
m_ListInfoCtrl.SetItemText( nLruIndex-1, 1, strLruName );
//---- LRU Type -----------
m_pFrame->m_DbMgr.m_Rs.GetFieldValue( "LruType", nLruType );
strTemp = m_pFrame->m_strLruType[nLruType-7001];
m_ListInfoCtrl.SetItemText( nLruIndex-1, 2, strTemp );
//----- MIl Bus ----------------
m_pFrame->m_DbMgr.m_Rs.GetFieldValue( "MilBus", strTemp );
strTemp.Insert( 0, " " );
m_ListInfoCtrl.SetItemText( nLruIndex-1, 3, strTemp );
//---- RtNumber -----------
m_pFrame->m_DbMgr.m_Rs.GetFieldValue( "RTNumber", nRtNumber );
strTemp.Format( "%d", nRtNumber );
if ( nRtNumber>0 )
m_ListInfoCtrl.SetItemText( nLruIndex-1, 4, strTemp );
//---- No Of Arinc Ch -----------
m_pFrame->m_DbMgr.m_Rs.GetFieldValue( "NoOfArincCh", nNoOfArincCh );
strTemp.Format( "%d", nNoOfArincCh );
if ( nNoOfArincCh>0 )
m_ListInfoCtrl.SetItemText( nLruIndex-1, 5, strTemp );
//---- No Of Serial -----------
m_pFrame->m_DbMgr.m_Rs.GetFieldValue( "NoOfSerialPort", nNoOfSerialPort );
strTemp.Format( "%d", nNoOfSerialPort );
if ( nNoOfSerialPort>0 )
m_ListInfoCtrl.SetItemText( nLruIndex-1, 6, strTemp );
//---- No Of Discrete -----------
m_pFrame->m_DbMgr.m_Rs.GetFieldValue( "NoOfDiscreteCh", nNofDiscreteCh );
strTemp.Format( "%d", nNofDiscreteCh );
if ( nNofDiscreteCh )
m_ListInfoCtrl.SetItemText( nLruIndex-1, 7, strTemp );
//----- Description ----------------
m_pFrame->m_DbMgr.m_Rs.GetFieldValue( "Description", strDescription );
m_ListInfoCtrl.SetItemText( nLruIndex-1, 3, strDescription );
m_pFrame->m_DbMgr.m_Rs.MoveNext();
}
}catch( CADOException& e )
{
strSql = "CSIRBaseView::UpdateListControl():GetFieldValue "+e.GetErrorMessage();
MessageBox( strSql ); return FALSE;
}
|
|
|
|
|
Why don't you use the debugger to see the value of strTemp on execution of the offending lines:
m_pFrame->m_DbMgr.m_Rs.GetFieldValue( "MilBus", strTemp );
strTemp.Insert( 0, " " );
m_ListInfoCtrl.SetItemText( nLruIndex-1, 3, strTemp );
?
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,
It is coming yaar.
strTemp is showing the value " MilBus"
But it is not able to display the value only for that column.
Remaining columns it is showing the values
|
|
|
|
|
Hi,
are you there?
Please help me.
|
|
|
|
|
Yes, I'm here. I would try to simplify the debug approach, for instance try to pass a fixed string to such column.
You may also check the state of that column against the other ones.
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,
I tried by passing fixed string still it is not coming.
what to do?
Still I have I more big problem?
My List control displays about LRU names. It will be stored in access database
If we delete one LRU name in between 20 lru names ie 20 rows.
If i delete 10 th row. ie 10 th record in the database.
Again I will refresh the list control. at this time
nothing is displaying after 10 th record only first column ie LRU index it is displaying remaining columns it is showing any thing.
while reading from DB table the values are coming but list control is not displaying.
Please help me?
Otherwise our whole project will be stopped.
|
|
|
|
|
Hi Pallini?
are you there?
|
|
|
|
|
You already posted a question about this stuff, and I thought it was fixed?
|
|
|
|
|
no yaar
it was not fixed.
How to solve this problem.
|
|
|
|
|
Sakhalean wrote: no yaar
Hey, I thought 'Talk Like A Pirate Day' was in September!
|
|
|
|
|
what do you mean?
yaar means friend
|
|
|
|
|
|
You are setting columns 1 to 7, and then column 3 again, so that is only eight columns altogether (main item is column 0). Your first message stated that you have 10 columns. Run it through the debugger and check what values you are trying to set for each column.
It's time for a new signature.
|
|
|
|
|
The values are showing but it is not displaying.
iam able to see the values what iam going to display
but it is not displaying.
|
|
|
|
|