|
hi!! thanks to everyone. the problem has been solved. i didnot close the find file object after enumerating all the files once. that was the cause for the problem. thanks to everyone
vijay aroli
|
|
|
|
|
I am looking for the most basic example of word automation. I have looked at all of them on this webiste and they are all too complex for me. All I need is couple of lines of code (no interface at all) on how to create a completely blank word file with the path specified by me (like c:\\myfile.doc). How can I do that??
Thanks in advance!
|
|
|
|
|
Search microsoft MSDN site for:
Q180616: HOWTO: Use Automation to Create & Show a PowerPoint Presentation
Q178784: HOWTO: Use Automation to Open and Print a Word 97 Document
Old articles, but easiest way. Searching for automate brings nice examples as well.
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
where can I find the msword.h file??
-- modified at 9:54 Friday 18th August, 2006
|
|
|
|
|
great_tommy wrote: where can I find the msword.h file??
It, along with a .cpp file, is created by ClassWizard when you import the type library.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
VC6.0
My Application: the same window explore
I cut 2 files in window explore, then in my application
I paste them there. How to know that:
1. 2 files are cutting
2. Path is exist
3. ListCtrl control: how to sort folders are top, files are bottom
Thanks
|
|
|
|
|
|
VC6.0
My Application: the same window explore
I cut 2 files in window explore, then in my application
I paste them there. How to know that:
1. 2 files are cutting
2. Path is exist
3. ListCtrl control: how to sort folders are top, files are bottom
Thanks
|
|
|
|
|
Hi,
plz tell me. how can i read excel sheet using visual c++ MFC.
i have write following code but it reads only three rows.
void CReadExcelDlg::OnButton1()
{
CDatabase database;
CString sSql;
CString sItem1, sItem2,sItem3;
CString sDriver;
CString sDsn;
CString sFile = "ReadExcel.xls"; // the file name. Could also be something like C:\\Sheets\\WhatDoIKnow.xls
// Clear the contents of the listbox
m_ctrlList.ResetContent();
sDriver = GetExcelDriver();
if( sDriver.IsEmpty() )
{
// Blast! We didn´t find that driver!
AfxMessageBox("No Excel ODBC driver found");
return;
}
sDsn.Format("ODBC;DRIVER={%s};DSN='';DBQ=%s",sDriver,sFile);
TRY
{
database.Open(NULL,false,false,sDsn);
CRecordset recset( &database );
sSql = "SELECT field_1, field_2 "
"FROM demo_table "
"ORDER BY field_1";
recset.Open(CRecordset::forwardOnly,sSql,CRecordset::readOnly);
while( !recset.IsEOF() )
{
// Read the result line
recset.GetFieldValue("field_1",sItem1);
recset.GetFieldValue("field_2",sItem2);
// recset.GetFieldValue("field_3",sItem3);
// Insert result into the list
m_ctrlList.AddString( sItem1 + " --> "+ sItem2 );
// Skip to the next resultline
recset.MoveNext();
}
// Close the database
database.Close();
}
CATCH(CDBException, e)
{
// A database exception occured. Pop out the details...
AfxMessageBox("Database error: "+e->m_strError);
}
END_CATCH;
}
////plz help me
|
|
|
|
|
kamlesh9873 wrote: how can i read excel sheet using visual c++ MFC
may be this[^] helps
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
kamlesh9873 wrote: ...but it reads only three rows.
Out of how many?
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
|
It doesn't matter to me one way or the other, but I'm just curious why you'd repeat what _AnShUmAn_ did but to another site?
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I wanted said to you ...and now I'm curious why you think its a repeat and i was wondered why you said it but when i see authors from these articles now I'm curious and wonder (one authors,one object) all things are same now i can say
|
|
|
|
|
As it happens I have just created a set of classes which is able to read Excel files without MFC, COM or even having to have excel stored on the machine. I found it to be some 1000% faster than convensional means.
I will make it public just as soon as I find the time to write a CP article. In the meantime if anybody is interested drop me a message.
|
|
|
|
|
I have a view derived from CListView.
In a button handler i wrote
CListCtrl &listCtl=GetListCtrl();<br />
for(int j =0 ;j<4;j++)<br />
listCtl.SetItemText(i,j,arr->GetAt(j))
arr is a CStrinArray. GetAt is returning the string right. and value of i is 1. And i have set 4 coulumns for the ListView.
But the SetItemText is always returning 0.
Can you please show me the reason.
Thank you
KIRAN PINJARLA
|
|
|
|
|
What is arr ?
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
it's a CStringArray, it's written in the original post.
|
|
|
|
|
Maximilien wrote: it's written in the original post
me tired. Thanks.
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
of course CStringArray *arr; and it seems to it has two for i,j but he writes a for
|
|
|
|
|
kiran.pinjarla wrote: and value of i is 1.
So you are wanting to change the second row, correct?
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Just out of curiosity; Have you inserted any item in list control, before setting text? Or there are items present in control ?
kiran.pinjarla wrote: for(int j =0 ;j<4;j++)
initialize j with 1 and check.
|
|
|
|
|
Ok I got it. The Problem was i did not do InsertItem before going for InsertItemText. that was the problem.
Thank You.
KIRAN PINJARLA
|
|
|
|
|
Hi
I have two edit controls , 1 OK button and 1 Cancel Button.The code for the first editbox's EN_KILLFOCUS event is as follows:
void CTrial1Dlg::OnKillfocusEdit1()
{
// TODO: Add your control notification handler code here
CEdit *pEdit;
CString str;
double d1;
GetDlgItemText(IDC_EDIT1,str);
if(str.CompareNoCase(_T(""))!=0)
{
d1=_tcstod(str,NULL);
if(d1 > 3)
{
AfxMessageBox(_T("Greater than 3.Enter less than 3"));
pEdit = (CEdit *)GetDlgItem(IDC_EDIT1);
pEdit->SetFocus();
}
}
}
when I enter a number greater than 3 the message is displayed.As long as I press "OK" the message will be raised.The message will be raised even if I press "OnCancel".
My requirement is when the message is displayed and if I press the "Cancel" button the dialog should end.As I am using setfocus(), how can I do this?
Thanks in advance.
Sandhya
|
|
|
|
|
Wouldn't it be better to override OnOk() and OnCancel() ? So that in OnOk() you can check if the string is correct or not. If not, don't call CDialog::OnOk() so that the dialog won't be closed (and display a warning message).
I find this solution 'better' because the user won't have a message everytime he does something in the dialog, only when he wants to click on the ok button.
|
|
|
|