|
i found it can work with only where there is a space" ";
such as CString str="afasdfwe adf adsf efs dfe asfe af";
wordwrap occurs at the space character" ";
if the CString str ="adfasdfewfwegfregergruwergrgqa";
why can't the wordwrap function work?
|
|
|
|
|
zeus_master wrote: if the CString str ="adfasdfewfwegfregergruwergrgqa";
Where should it break?
Nibu thomas
Software Developer
Faqs by Michael dunn
|
|
|
|
|
anywhere, depends on the width of the cells?
|
|
|
|
|
Hi ,
From the below code it displays the file name on the output screen,can anyone please tell how to add them to List box ??
I have list box IDC_OUTPUT CListCtrl m_output.
-----------------------------------
if (e != NULL) {
readFiles (e->left);
fp = fopen (e->filename, "r");
fnum++;
if ((s = (char*)strrchr(e->filename, '/')) == NULL)
cout << e->filename; //Prints file name
else
cout << e->filename; //Prints File name
insert (fnum, e->filename);
if (fp) {
wds = getWord (fp,fnum);
}
cout << " (" << wds << " words)" << endl; //Prints number of words
fclose (fp);
------------------------------------
Regards,
Parichay.
|
|
|
|
|
hi parichaya,
u want to add to ListBox or ListControl?
r u from AP?
|
|
|
|
|
Hi,
its List Control.
I am from Bangalore.
|
|
|
|
|
hii,
where r u working in b'lore?
|
|
|
|
|
Hey i am nt working,i am doing my MCA project work.
|
|
|
|
|
good.
may i know on which project u r doing?
ur name?
|
|
|
|
|
|
Hi,
Thanks for the reply,
its CListCtrl,
|
|
|
|
|
Use InsertItem of CListCtrl .
There is an example in MSDN related to this. Please look up InsertItem . I guess here you will have to use the report style(LVS_REPORT ).
Nibu thomas
Software Developer
Faqs by Michael dunn
|
|
|
|
|
Hi,
Thanks for the reply..I just checked the MSDN Ex..
---------------------
Example MSDN
// The pointer to my list view control.
extern CListCtrl* pmyListCtrl;
CString strText;
int nColumnCount = pmyListCtrl->GetHeaderCtrl()->GetItemCount();
// Insert 10 items in the list view control.
for (int i=0;i < 10;i++)
{
strText.Format(TEXT("item %d"), i);
// Insert the item, select every other item.
pmyListCtrl->InsertItem(
LVIF_TEXT|LVIF_STATE, i, strText,
(i%2)==0 ? LVIS_SELECTED : 0, LVIS_SELECTED,
0, 0);
// Initialize the text of the subitems.
for (int j=1;j < nColumnCount;j++)
{
strText.Format(TEXT("sub-item %d %d"), i, j);
pmyListCtrl->SetItemText(i, j, strText);
}
}
----------------------------------------
extern CListCtrl* pmyListCtrl;
can u tell me what the use of the above statment ??
|
|
|
|
|
parichaybp wrote: extern CListCtrl* pmyListCtrl;
can u tell me what the use of the above statment ??
This is just an indication that pmyListCtrl is declared elsewhere. Most of the samples have this kind of declaration.
You can ignore this and concentrate on the essentials.
Nibu thomas
Software Developer
Faqs by Michael dunn
|
|
|
|
|
parichaybp wrote: extern CListCtrl* pmyListCtrl;
Meaning the variable CListCtrl* pmyListCtrl is declared somewhere else (another .cpp file) outside this cpp file.
Maxwell Chen
|
|
|
|
|
Hi Maxwell Chen,
Hope U still Remember me..
i just tried with this statment
CString strText = "hello";
m_OUTPUT->SetItemText(1, 1, strText);
is this correct ???
|
|
|
|
|
Yes I remember you.
Regarding to a CListCtrl, you had better use the structured data to feed it. As what WhiteSky has provided (THE REPLY[^]) 3 min earlier.
[Edit]
A second method is to use CListCtrl::InsertItem(nIndex, sStr) , if it contains only one column.
[/Edit]
Maxwell Chen
|
|
|
|
|
parichaybp wrote: extern CListCtrl* pmyListCtrl;
can u tell me what the use of the above statment ??
And that's why I have suggested you to read a book about the syntax of C++ Language.
Maxwell Chen
|
|
|
|
|
<br />
void CAnswerView::FillList(CListCtrl *m_ListCtrl,CListBox *m_ListBox,CString str)<br />
{<br />
if(m_ListCtrl)<br />
{<br />
LV_ITEM Item2={0};<br />
<br />
Item2 .mask = LVIF_TEXT| LVIF_STATE|LVIF_PARAM;<br />
Item2 .iItem =m_ListCtrl->GetItemCount(); <br />
Item2 .pszText = CA2T(str);<br />
Item2 .stateMask = LVIS_STATEIMAGEMASK;<br />
Item2 .state = INDEXTOSTATEIMAGEMASK(1);<br />
m_ListCtrl->InsertItem( &Item2);<br />
<br />
}<br />
<br />
if(m_ListBox)<br />
{<br />
m_ListBox->AddString(str);<br />
m_ListBox->InsertString(0,str);<br />
}<br />
}<br />
|
|
|
|
|
Hi WhiteSky,
CListCtrl *m_OUTPUT;
CString strText = "hello";
m_OUTPUT->SetItemText(1, 1, strText);
is the above statment correct ?? i tryed but its not giveing any output.
|
|
|
|
|
CListCtrl::SetItemText is to alter the text of an existing entry in that CListCtrl.
If there has not any entry in that control, what you are using is invalid.
Thus we have suggested you to use CListCtrl::InsertItem .
Maxwell Chen
|
|
|
|
|
I suggest that you read Msdn also example from ClistCtrl
|
|
|
|
|
Hi All,
i am doing MS word automation in MFC. i have added Word Document in CDialog using View. i want to disable the some of the functionalities of the word like undo. i have open the existing word file in word document using this line of code.
Range wdRange;
wdRange.InsertFile(m_FilePathName,covOptional, covOptional, covTrue,covOptional);
_Application app;
app.SetDisplayScrollBars(TRUE);
now this scroll bar is visible only once after that it will disappear.
i want to set the zoom percentage,paper size,font size and font type also.
if anyone have the idea regarding this context then please let me know asap.
thanks in advance
Vikas Tayal
|
|
|
|
|
hi all,
I want to access the Password of the User if the Username is know in a WorkStation or LAN. Is there any Api to retrieve the Password of the Remote User.
please let me know.
thanks,
uday.
uday kiran
-- modified at 1:47 Monday 8th May, 2006
|
|
|
|
|
Before going to get the passowrd of user in LAN..Let me ask
Do u know any api to get the username of current login user..?
nave
|
|
|
|