|
|
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
|
|
|
|
|
hai nave,
to get the Current user Logged in we have to use
GetUserName(...) Api, but i dont know the password APi for the User. Is it possible to retrieve the Password Also, please if yes let me know.
uday.
uday kiran
|
|
|
|
|
I think thats not possible...
nave
|
|
|
|
|
You can't get a user's password because a) it would be a huge security hole and b) the system doesn't store the password anyway, only a hash of it.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
kiran janaswamy wrote: I want to access the Password of the User if the Username is know in a WorkStation or LAN.
Guess somebody using this API to get into your system! Guess the havoc!
If such an API was there then what's the use of a Password!
Nibu thomas
Software Developer
Faqs by Michael dunn
|
|
|
|
|
Nibu thomas wrote: If such an API was there then what's the use of a Password!
Keyword.
Maxwell Chen
|
|
|
|
|
Hi all
I am having a problem here.
I want to create a plug in for already exising application.
Already existing application is for wiping files and other traces, so here I need to give the support for P2P application's traces in the Wiping Application.
For this I want to create a plugin which add an extra tab in the application, for wiping P2P application's traces.
Here Alread exixsting application is a dialog application.
Please guide me to proceed ( I never worked on making Plug in or DLL like project, so plz help accordingly)
Thanks
|
|
|
|
|
I am attempting to write to a special serial device that requires one I/O to be sent for both reads and writes. The device receives a packet of information, like what would be sent on a WriteFile, and then expects to fill in a packet of data and return it like ReadFile.
Neither readfile or writefile will work, since write only sends packets and reads only retrieve them. The device will not operate with two IOs, as in a writefile/readfile sequence.
Does anyone know of an API call I can make to accomplish this? DeviceIOControl allows for both input and output packets, but I cannot find an IOCTL that implies it will do this.
Any help would be appreciated.
Thanks
Bill
Bill
|
|
|
|
|
What you are describing sounds like the device and application would have to access the same memory. I am not sure that makes any sense if you are using a serial port for communications. Did I miss something?
"What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum
led mike
|
|
|
|
|
I want to give password protection to one of my screens. I am calling this do while loop in the initinstance of that screen the problem is now if i press cancel button then the password dialog box should go but its not going and if its going then it opens my screen.
do
{
if(password.DoModal()==IDOK)
{
if(password.m_strPassword !=File.getKeyValue("PASSWORD","password"))
AfxMessageBox("Invalid Password ");
}
}while(password.m_strPassword !=File.getKeyValue("PASSWORD","password"));
Please Help me out
|
|
|
|