473,386 Members | 1,883 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Virtual List view using managed c++ .net (how ?)

Please help me

I am trying to port over some old 3rd party code (using XVT), and am using .net via managed c++. All my buttons and edit controls look great. However i can't get a virtual OWNERDATA listview working. I have tried extending the get_CreateParams with the LVS_OWNERDATA style but spy++ does not show that this works, also i never get the WM_NOTIFY message (i have extend the WndProc method). Please can someone tell me what i am doing wrong, it is driving me nuts

Here is my code so far (its a bit messy but i hope shows the problem

#include "windows.h
#include "commctrl.h

#undef MessageBo

__gc class virtualListBox : public System::Windows::Forms::ListView
public
virtualListBox()
FullRowSelect = true
GridLines = true
View = System::Windows::Forms::View::Details
protected: __property virtual System::Windows::Forms::CreateParams* get_CreateParams(

System::Windows::Forms::CreateParams* defParams = System::Windows::Forms::ListView::get_CreateParams ()
defParams->Style = defParams->Style & ~LBS_HASSTRINGS
defParams->Style = defParams->Style & ~LBS_SORT
defParams->Style = defParams->Style | LVS_OWNERDATA | LVS_SHOWSELALWAYS | LVS_SINGLESEL
defParams->ExStyle = defParams->ExStyle | LVS_EX_FULLROWSELECT | LVS_EX_LABELTIP
return defParams
public: __property int get_Count()
int value = Handle.ToInt32()
return ::SendMessage( reinterpret_cast<HWND>( value ), LVM_GETITEMCOUNT, 0, 0 )
public: __property void set_Count( int count )
int value = Handle.ToInt32()
::SendMessage( reinterpret_cast<HWND>( value ), LVM_SETITEMCOUNT, count, 0 )
[System::Security::Permissions::PermissionSet(Syste m::Security::Permissions::SecurityAction::Demand, Name="FullTrust")
virtual void WndProc( System::Windows::Forms::Message* m )
// Listen for operating system messages

switch ( m->Msg )

case WM_NOTIFY : {
int value = m->LParam.ToInt32()

NMHDR* pNmhdr = (NMHDR*)value
UINT testCode = LVN_GETDISPINFOA
UINT nCode = ( NULL != pNmhdr ) ? pNmhdr->code : -1
if ( nCode == LVN_GETDISPINFOW || nCode == LVN_GETDISPINFOA )
System::Windows::Forms::MessageBox::Show( S"got here" )

if ( nCode == LVN_ITEMCHANGED )
System::Windows::Forms::MessageBox::Show( S"item changed" )

if ( nCode == LVN_ODCACHEHINT )
System::Windows::Forms::MessageBox::Show( S"a1" )

if ( nCode == LVN_ODFINDITEM )
System::Windows::Forms::MessageBox::Show( S"a2" )
break
case WM_COMMAND
WORD hi = HIWORD( (int)m->WParam )
WORD low = LOWORD( (int)m->WParam )
break

__super::WndProc(m)
}

Nov 17 '05 #1
0 1765

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Anushya | last post by:
Hi I am trying to add image items to listview. Here how to handle if i need to add images?? Pls go thru the code. In the form where i have used this virtualListView, have handled...
9
by: Neil | last post by:
I've been discussing here a SQL 7 view which scrolls slowly when linked to an Access 2000 MDB. After trying various things, I've distilled it down to the following: when the linked view has a...
14
by: JPRoot | last post by:
Hi I use the following syntax to have events inherited from base to child classes which works nicely (virtual and override keyword on events). But I am wondering if it is a "supported" way of using...
8
by: JPRoot | last post by:
Hi M. Jeffrey Tan, Just hopping you didn't forget me? :) Thanks JPRoot ----- \"Jeffrey Tan\" wrote: -----
0
by: Brian Henry | last post by:
Since no one else knew how to do this I sat here all morning experimenting with this and this is what I came up with... Its an example of how to get a list of items back from a virtual mode list...
0
by: Brian Henry | last post by:
Here is another virtual mode example for the .NET 2.0 framework while working with the list view. Since you can not access the items collection of the list view you need to do sorting another...
7
by: ZenRhapsody | last post by:
Are ALL methods in subclasses implemented in C# with vtables and virtual functions? I know I could test this myself, but I'm still using Express edition of 2.0, so I cannot view the optimized...
6
by: Gerhard Prilmeier | last post by:
Hello, I have an unmanaged C++ API that uses virtual functions, like this: class A { public: virtual void handleMe(){} };
17
by: Jess | last post by:
Hello, If I have a class that has virtual but non-pure declarations, like class A{ virtual void f(); }; Then is A still an abstract class? Do I have to have "virtual void f() = 0;"...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.