15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


CListCtrl problems...

Reza Razavipour -- biles.com!reza_r@jabberwock.biles.com
Wednesday, September 20, 1995


A puzzling problem, a code snipet follows:


	lvI.mask = LVIF_TEXT; 

	for (index = 0; index < 9; index++)
	{
		lvI.iItem = index;
		lvI.iSubItem = 0;
	        lvI.pszText = "THIS POINT";  
	        //lvI.pszText = LPSTR_TEXTCALLBACK; 
		
		if (m_PointList.InsertItem(&lvI) == -1)
		{
			AfxMessageBox("I Failed to fill up the list of points");
			return;
		}
	}


The above code InsertItems works fine but when I replace "THIS POINT" with LPSTR_TEXTCALLBACK, the 
InsertItem fails. Any clues???

TIA 
Reza



Mike Blaszczak -- blaszczak@BIX.com
Thursday, September 21, 1995

biles.com!reza_r@jabberwock.biles.com (Reza Razavipour) wrote:

 > The above code InsertItems works fine but when I replace
 > "THIS POINT" with LPSTR _TEXTCALLBACK, the InsertItem fails.
 > Any clues???

The SDK says "Do not set the pszText member to LPSTR_TEXTCALLBACK if the
list view control has LVS_SORTASCENDING or LVS_SORTDESCENDING style."

Is that what you're doing?

.B ekiM



Reza Razavipour -- biles.com!reza_r@jabberwock.biles.com
Thursday, September 21, 1995

Thank you so very much, that was it. I set it to sort None and all is well.

Where did you read that? I read everything on thte MSDN CD and found nothing 
like that. I would be very interested in finding where you read that.

Thank you very much,

Reza.



Mike Blaszczak -- blaszczak@BIX.com
Saturday, September 23, 1995

biles.com!reza_r@jabberwock.biles.com (Reza Razavipour) wrote:

 > Thank you so very much, that was it. I set it to sort
 > None and all is well.

Good!

 > Where did you read that? I read everything on thte
 > MSDN CD and found nothing like that. I would be very
 > interested in finding where you read that.

I used the Win32 SDK's help file.  I opened it to this place:

Win32
   Reference
      Structures
         HD_HITTESTINFO to MSG
            LV_ITEM [New - Windows NT]

and read the description for the pszText member of that structure.

Of course, I didn't immediately open the reference to this
place right off the bat; there are easy ways to jump to that topic
if you're browsing the regular documentation for the control in
the Win32 SDK Overviews.

The only MSDN CD I have at home right now is the April 1995 issue,
which doesn't document Windows NT 3.51 or Windows 95, so I can't
tell you exactly where the text would be on the MSDN disk.

.B ekiM




B Chandra Sekhar -- int@pacific.net.sg
Tuesday, August 20, 1996

Hi !

I have a few questions regarding the CListCtrl class.

1. Does the style LVS_SORTASCENDING specified during Create , really
sort the objects in the List control ?

2. I have tried using the Arrange member function with the LVA_SORTASCENDING
parameter, after adding items into the list control. I get a compiler error.

3. If I use the LVS_SORTASCENDING style, in Report View, I am not able to see
the subitems of a some of the items. Incidentally, the items are sorted !!! 

If you have used the CListCtrl class extensively, then can you please help me
out with these problems ?

I would appreciate any help in this regard.

Environment : VC++ 4.0, Windows 95
Thanks
Srini









| Вернуться в корень Архива |