|
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
|
|
|
|
|
|
ok...
then add your application's path under
"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run" registry key.
Mukesh Kumar
Software Engineer
|
|
|
|
|
Can I know why my answers are voted down?
Mukesh Kumar
Software Engineer
|
|
|
|
|
I wonder if you could show me how to write those codes in C++/MFC ? ( I have an assignment with that problem ...
|
|
|
|
|
Oh... It means if I write complete code for your assignment then it is ok, otherwise you will voted down my answers.
Hints are not enough for you.
Thanks buddy...
Mukesh Kumar
Software Engineer
|
|
|
|
|
I don't mean so. If you know any useful function about that problem you can tell me & I'll make my own code ... Anyway, thanks for your reply. Ofcourse, I'll vote for you
|
|
|
|