|
Hi,
And my suggestion is that place the Count of each message type at begining of the file
like
TSW0003TSE0003
TSI0001 "iNFORMATION Message".
TSW0001 "WARNING Message".
TSE0001 "WARNING Message"...
TSI0002 "iNFORMATION Message".
TSW0002 "WARNING Message".
TSE0002 "WARNING Message"...
at the first line of the txt file. Then read this first before. Split or parse it . then increment your Count based on that.
that' s it
Nitheesh
|
|
|
|
|
hi..
what changes i have to meke in my code..
manju
Hi..
I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++
manju
|
|
|
|
|
Apart the api "IsWndow" which the microsoft doesnt recommend to be used other than by the thread which had created the window,is there any method to check for a valid hwnd i.e from an another thread?
dont want,dont want thinking,climbing on head and jumping grass!
(venda venda ennu vicharikumbol thellayill keyaree chadunnoda pulle!)
|
|
|
|
|
From MSDN:
A thread should not use IsWindow for a window that it did not create because the window could be destroyed after this function was called. Further, because window handles are recycled the handle could even point to a different window.
Are you sure this is a concern? If you're going to do anything with the HWND the same applies (it could be destroyed). Just use IsWindow .
Steve
|
|
|
|
|
If the target window is a top level window you can install a hook (see WH_SHELL) to be notified about destroying top level windows.
But frankly, no matter what technique you use, you can be never sure. If everything looks ok and you send a message to that window, the window still can be destroyed in the same moment(almost the same). Or while is processing your message. Simply there is no way to prevent a foreign window from beeing destroyed anytime.
The only thing you can do is to implement thoroughful error processing, verify the effects of each of the messages sent and check regularly if the handle is still for the same window and not reused for another one.
Working with a foreign windows is something similar to working with dialog boxes. You can never be sure what stupidity will a user type in an edit box so you have to check everything.
I think a window beeing destroyed exactly in the very moment when you need it, is a very rare occurence. Just make sure to limit to minimum the damages of such an event. If your software stops abruptly and hours of the user's unsaved work are gone, that's unacceptable. If the only thing that happens is an error message "Internal error, please repeat the last command", that's acceptable, even if it's not desirable. Even the best software fails sometimes. The only question is how it fails: disastruously or gracefully ?
|
|
|
|
|
hi...
I have an application which send data to some "InputData.txt".
Now if i click " FILE->Save " then it needs to be ask for saving that "InputData.txt" in browsed Location!!
can u help in this regard..
Thanks in advanvce!!!!!
|
|
|
|
|
So, was your previous query solved? Why don't you take a little time to thank the ones who solved it before asking the next question?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
I adjust for troll's vote for now as I think CPallini will take some more hours.
|
|
|
|
|
I think he is sleep now.
|
|
|
|
|
Thanks for the vote man. I appreciate it.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
I see that as the advance adjustment for the foreseen troll's vote.
|
|
|
|
|
Hi,
Handle the Save click and in Save Click handler do the Following
CFileDialog dlg;
if(dlg.DoModal() == IDOK)
{
CString fileName = dlg.GetPathName();
}
thanks
Nitheesh
|
|
|
|
|
If you properly used SDI framework in MFC, it will do for you.
|
|
|
|
|
In my application i have some buttons.... if i click them then some data will be stored in a buffer.i need that data to be stored in a File.
How can i do that.....
and
If i click File->Save ,then which handler will be called and how can i override that function to save my data in Text File!!!!!
THANKS in advance....
|
|
|
|
|
Are you using MFC SDI? [Implicit Creation of a CArchive Object via the Framework^] It will call the <cdocument derived="" class="">::Serialize() you may refer msdn for MFC Serialization.
Otherwise, you need to use APIs for showing up Browse for file dialog and use file APIs to write data.
|
|
|
|
|
From CMainFrame to CMainFrame (same source and destination) send a WM_COMMAND message:
SendMessage( WM_COMMAND, ID_FILE_SAVE_AS, 0);
modified on Sunday, May 11, 2008 6:54 AM
|
|
|
|
|
Hi ,,,,
How to disable Menu item in SDI application.
|
|
|
|
|
Add an ON_UPDATE_COMMAND_UI handler and corresponding handler to enable or disable menu items.
Something like...
ON_UPDATE_COMMAND_UI( ID_EDIT_CLEAR, ClearAll ), so ClearAll function should have the following signature...
afx_msg void ClearAll(CCmdUI *pCmdUI);
Call pCmdUI->Enable( FALSE ); to disable menuitem.
Nibu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
simply add ON_UPDATE_COMMAND_UI event handler for that menu item.
and disable menu item. like
pCmdUI->Enable(FALSE);<br />
Mukesh Kumar
Software Engineer
|
|
|
|
|
Thanks!!!! it works fine ......
|
|
|
|
|
|
Hi,
Iam Using CTreeView to Construct a Tree. If i delete any node in the tree
it is collapsing.
void CRunSetView::DeleteFilters(HTREEITEM hselected)<br />
{<br />
CTreeCtrl& TreeCtrl = GetTreeCtrl();<br />
HTREEITEM Parent = TreeCtrl.GetParentItem(hselected);<br />
<br />
short nRunsetId = GetItemID(Parent);<br />
HTREEITEM ChildItem = TreeCtrl.GetChildItem(hselected);<br />
<br />
do<br />
{<br />
short nMapId = GetItemID(ChildItem);<br />
<br />
<br />
CMigratorClient* pManager = GetDocument()->GetManagerPtr();<br />
<br />
CMigratorDoc* cmap = GetDocument();<br />
_RecordsetPtr rsMap;<br />
rsMap.CreateInstance(__uuidof(Recordset));<br />
<br />
<br />
CString strSQL;<br />
strSQL.Format(_T("SELECT * FROM DQMap WHERE ID = %d"),nMapId);<br />
rsMap->Open( _variant_t( strSQL ), _variant_t(( IDispatch *) pManager->GetDatabasePtr(), <br />
true), adOpenStatic, adLockOptimistic, adCmdText);<br />
<br />
if ( !rsMap->GetEndOfFile() )<br />
{<br />
CString MapNm = VariantToStr( rsMap->Fields->Item["FilterName"]->Value );<br />
rsMap->Close();<br />
<br />
<br />
_RecordsetPtr rsMapDQ;<br />
rsMapDQ.CreateInstance(__uuidof(Recordset));<br />
strSQL.Format(_T("SELECT * FROM DQMap WHERE FilterName = '%s'"),MapNm);<br />
rsMapDQ->Open( _variant_t( strSQL ), _variant_t(( IDispatch *) pManager->GetDatabasePtr(), <br />
true), adOpenStatic, adLockOptimistic, adCmdText);<br />
<br />
while( !rsMapDQ->GetEndOfFile() )<br />
{ <br />
<br />
nMapId = _ttoi( VariantToStr( rsMapDQ->Fields->Item["ID"]->Value ));<br />
<br />
<br />
short mapid;<br />
<br />
<br />
<br />
CMigratorClient* pManager = GetDocument()->GetManagerPtr();<br />
pManager->DeleteRunSetMap(nRunsetId,nMapId);<br />
<br />
cmap->deletefilters(nMapId);<br />
<br />
rsMapDQ->MoveNext();<br />
<br />
<br />
}<br />
rsMapDQ->Close();<br />
}<br />
<br />
<br />
}while((ChildItem = TreeCtrl.GetNextSiblingItem(ChildItem))!=NULL);<br />
<br />
HTREEITEM item = GetRootItem();<br />
DeleteItem(item);<br />
OnInitialUpdate();<br />
<br />
<br />
return;<br />
}<br />
Plz look at it , give any idea.
|
|
|
|
|
I'm writing a MFC application and I want to make it run when window start. I found an article in CodeProject but it is written in VB. Some one can help me, plz ...
|
|
|
|
|
Just put your application in startup. It will run when windows start.
Mukesh Kumar
Software Engineer
|
|
|
|
|