Link to home
Start Free TrialLog in
Avatar of hon67
hon67

asked on

Virtaul listview?

Dear All,

I know a control item which is called virtual listview is existed and I have read the article posted at the online library at microsoft.

My operating system is Window 98, the version of the following files

comctl32.dll is 4.72.3110.1
shell32.dll is 4.72.3110.6
shlwapi.dll is 4.72.3110.0

Also, I am using the professional edition of VC5.0 to develop my application.

How can I develop a virtual listview under this environment?
My project's view class is CFormView. I haev tried to add a listview at the resource editor but it doesn't contain the property LVS_OWNERDATA...Also, I cannot use the function SetItemCountEx(..).

Thanks!!!
ASKER CERTIFIED SOLUTION
Avatar of pau_serra
pau_serra

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of hon67
hon67

ASKER

Dear pau_serra,

My project's view class is CFormView. How can I modify your code to implment the same thing?

At the function PreCrateWindow, I have tried to modify the following code from:

cs.style&=~LVS_TYPEMASK;
cs.style = cs.style | LVS_REPORT | LVS_SHOWSELALWAYS | LVS_OWNERDATA;

to
CListCtrl m_list1;
DWORD ListStyle = LVS_REPORT;
m_list1.ModifyStyle(ListStyle,LVS_REPORT|LVS_SHOWSELALWAYS|LVS_OWNERDATA,0);

and put this in the OnInitialUpdate(..) Function.

Others are same, however, I get an debug assertion error.......

How can I modify your code?

Thanks!!!
Ok hon67, here are the answer:

First of all, put a listctr in the dialog temaplate with ResourceEditor, and set onwer data in the 'more styles' tab.

(note from MS: Note Dynamically switching to and from the LVS_OWNERDATA style is not supported.)

Bind the resource with a CListCtrl using ClassWizard.

And all other is equal.

bye,

Avatar of hon67

ASKER

Hi pau_serra,

As I am using professional version of VC++5.0, there is no this option (LVS_OWNERDATA) at the more styles property page of the listview.

Is this mean that I cannot build a virtual listview in placing a listctrl from the resource editor?

Thanks!!!
Try this:

In the .rc file, search for the list control,  may look like this:

    CONTROL         "List1",IDC_LISTCTRL,"SysListView32", WS_BORDER | WS_TABSTOP,20,20,200,65

and set LVS_OWNERDATA manually:

    CONTROL         "List1",IDC_LISTCTRL,"SysListView32", LVS_OWNERDATA | WS_BORDER | WS_TABSTOP,20,20,200,65

Bye!