473,765 Members | 2,047 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_CreateParam s 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::ListVi ew
public
virtualListBox( )
FullRowSelect = true
GridLines = true
View = System::Windows ::Forms::View:: Details
protected: __property virtual System::Windows ::Forms::Create Params* get_CreateParam s(

System::Windows ::Forms::Create Params* defParams = System::Windows ::Forms::ListVi ew::get_CreateP arams()
defParams->Style = defParams->Style & ~LBS_HASSTRINGS
defParams->Style = defParams->Style & ~LBS_SORT
defParams->Style = defParams->Style | LVS_OWNERDATA | LVS_SHOWSELALWA YS | LVS_SINGLESEL
defParams->ExStyle = defParams->ExStyle | LVS_EX_FULLROWS ELECT | LVS_EX_LABELTIP
return defParams
public: __property int get_Count()
int value = Handle.ToInt32( )
return ::SendMessage( reinterpret_cas t<HWND>( value ), LVM_GETITEMCOUN T, 0, 0 )
public: __property void set_Count( int count )
int value = Handle.ToInt32( )
::SendMessage( reinterpret_cas t<HWND>( value ), LVM_SETITEMCOUN T, count, 0 )
[System::Securit y::Permissions: :PermissionSet( System::Securit y::Permissions: :SecurityAction ::Demand, Name="FullTrust ")
virtual void WndProc( System::Windows ::Forms::Messag e* m )
// Listen for operating system messages

switch ( m->Msg )

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

NMHDR* pNmhdr = (NMHDR*)value
UINT testCode = LVN_GETDISPINFO A
UINT nCode = ( NULL != pNmhdr ) ? pNmhdr->code : -1
if ( nCode == LVN_GETDISPINFO W || nCode == LVN_GETDISPINFO A )
System::Windows ::Forms::Messag eBox::Show( S"got here" )

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

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

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

__super::WndPro c(m)
}

Nov 17 '05 #1
0 1782

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

Similar topics

0
1621
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 QueryItemText.. And text alone is working fine.. using System; using System.Windows.Forms; using System.Diagnostics;
9
2385
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 virtual primary key, it is slow; when there is no virtual primary key, it scrolls quickly. Looking at Profiler, I see that when there is no virtual primary key, Access sends a simple select command to SQL Server. However, when there is a virtual...
14
12146
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 events since I never saw it used anywhere in MSDN documentation/samples?! Or it will just break when I upgrade to .NET Framework 2.x in the coming years namespace MyNamespac public delegate void MyDel() public class MyBase public virtual...
8
2895
by: JPRoot | last post by:
Hi M. Jeffrey Tan, Just hopping you didn't forget me? :) Thanks JPRoot ----- \"Jeffrey Tan\" wrote: -----
0
7541
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 view in .NET 2.0 with multiple selection turned on... since the .NET documentation is EXTREAML vague on how to do this and offers no clue on what the virtual mode events do or how to use them... just thought this might help someone else out...
0
3240
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 way... here is my code on how I did it to help anyone starting out get an idea of how to use virtual mode in ..NET 2.0 Imports CrystalDecisions.CrystalReports.Engine Imports CrystalDecisions.Shared
7
1462
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 disassembly. I know that you must use vtables for all virtual functions (and interfaces), but if there are non-virtual functions, does the compiler use a vtable for everything anyway?
6
3225
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
3547
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;" instead? I think declaring a function as "=0" is the same
0
9568
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9399
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10163
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9957
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9835
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7379
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5276
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.