Click here to Skip to main content
15,890,579 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Making a file not accessible by other applications Pin
vasu_sri22-Mar-07 3:01
vasu_sri22-Mar-07 3:01 
AnswerRe: Making a file not accessible by other applications Pin
prasad_som22-Mar-07 3:07
prasad_som22-Mar-07 3:07 
AnswerRe: Making a file not accessible by other applications Pin
Roger Stoltz22-Mar-07 2:48
Roger Stoltz22-Mar-07 2:48 
AnswerRe: Making a file not accessible by other applications Pin
DLChambers23-Mar-07 16:47
DLChambers23-Mar-07 16:47 
Questiona problem about ListBox's item Pin
Chen-XuNuo22-Mar-07 2:32
Chen-XuNuo22-Mar-07 2:32 
AnswerRe: a problem about ListBox's item Pin
prasad_som22-Mar-07 2:45
prasad_som22-Mar-07 2:45 
GeneralRe: a problem about ListBox's item Pin
Chen-XuNuo22-Mar-07 3:41
Chen-XuNuo22-Mar-07 3:41 
AnswerRe: a problem about ListBox's item Pin
CPallini22-Mar-07 2:46
mveCPallini22-Mar-07 2:46 
IT_DOER wrote:
Is the string saved in lpDrawItemStruct->itemData


Yes, it is passed as lpDrawItemStruct->itemData in DrawItem, see the folowing excerpt from MSDN:
...
void CMyListBox::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) 
{
   ASSERT(lpDrawItemStruct->CtlType == ODT_LISTBOX);
   LPCTSTR lpszText = (LPCTSTR) lpDrawItemStruct->itemData;
...



IT_DOER wrote:
And what is difference between calling AddString and SetItemData?


with SetItemData, you can associate e 32-bit integer to each item of the list (it is a value completely independent from the item text). Again, see the following sample from MSDN:
// The pointer to my list box.
extern CListBox* pmyListBox;

// Set the data of each item to be equal to its index.
for (int i=0;i < pmyListBox->GetCount();i++)
{
   pmyListBox->SetItemData(i, i);
}


Smile | :)







If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

GeneralRe: a problem about ListBox's item Pin
Chen-XuNuo22-Mar-07 3:13
Chen-XuNuo22-Mar-07 3:13 
GeneralRe: a problem about ListBox's item Pin
CPallini22-Mar-07 3:38
mveCPallini22-Mar-07 3:38 
GeneralRe: a problem about ListBox's item Pin
Chen-XuNuo22-Mar-07 3:44
Chen-XuNuo22-Mar-07 3:44 
GeneralRe: a problem about ListBox's item Pin
Chen-XuNuo22-Mar-07 3:24
Chen-XuNuo22-Mar-07 3:24 
GeneralRe: a problem about ListBox's item Pin
CPallini22-Mar-07 3:47
mveCPallini22-Mar-07 3:47 
QuestionSetTimer critical section problem Pin
D G McKay22-Mar-07 1:35
D G McKay22-Mar-07 1:35 
AnswerRe: SetTimer critical section problem Pin
James R. Twine22-Mar-07 1:46
James R. Twine22-Mar-07 1:46 
AnswerRe: SetTimer critical section problem Pin
kakan22-Mar-07 1:55
professionalkakan22-Mar-07 1:55 
GeneralRe: SetTimer critical section problem Pin
James R. Twine22-Mar-07 2:09
James R. Twine22-Mar-07 2:09 
GeneralRe: SetTimer critical section problem Pin
kakan22-Mar-07 2:19
professionalkakan22-Mar-07 2:19 
GeneralRe: SetTimer critical section problem Pin
D G McKay22-Mar-07 2:30
D G McKay22-Mar-07 2:30 
GeneralRe: SetTimer critical section problem Pin
kakan22-Mar-07 2:34
professionalkakan22-Mar-07 2:34 
AnswerRe: SetTimer critical section problem Pin
Parthi_Appu22-Mar-07 1:57
Parthi_Appu22-Mar-07 1:57 
GeneralRe: SetTimer critical section problem Pin
Michael Dunn22-Mar-07 10:14
sitebuilderMichael Dunn22-Mar-07 10:14 
GeneralRe: SetTimer critical section problem Pin
Parthi_Appu22-Mar-07 17:06
Parthi_Appu22-Mar-07 17:06 
AnswerRe: SetTimer critical section problem Pin
Stephen Hewitt22-Mar-07 13:00
Stephen Hewitt22-Mar-07 13:00 
QuestionCheck if is folder or file function? Pin
bosfan22-Mar-07 0:51
bosfan22-Mar-07 0:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.