PC Review


Reply
Thread Tools Rate Thread

Different ways of declaring listview or treeview control

 
 
Ken Warthen
Guest
Posts: n/a
 
      9th Sep 2008
What is the difference between the following two declarations? Is there an
advantage of one over the other?

Private lvxObj as MsComctlLib.ListView

Private lvxObj as ListView

Ken
 
Reply With Quote
 
 
 
 
Michel Walsh
Guest
Posts: n/a
 
      9th Sep 2008
In the first one, you specify the library you want to reach, in the second
case, you get the ListView from the first library which exposes such an
entity, and by 'first', that means an order, and the order is the one you
get by opening: Tools | References... (in VBE)

So, if you are lucky, of if only one library exposes a ListView entity, both
are equivalent.



The problem can be seen as in the case of Recordset:


Dim rst AS DAO.Recordset
and
Dim uvw AS ADODB.Recordset
and
Dim xzy AS Recordset


Is xyz be a DAO recordset, or an ADO recordset is anyone guess, and may even
change if ever your reference order changes!

So, unless you are pretty sure you won't have name collision from different
libraries, prefix with the library name.


Vanderghast, Access MVP


"Ken Warthen" <(E-Mail Removed)> wrote in message
news:CE2D88A9-AD7C-45A2-B9A8-(E-Mail Removed)...
> What is the difference between the following two declarations? Is there
> an
> advantage of one over the other?
>
> Private lvxObj as MsComctlLib.ListView
>
> Private lvxObj as ListView
>
> Ken



 
Reply With Quote
 
Ken Warthen
Guest
Posts: n/a
 
      9th Sep 2008
Michael,

Thanks for clearing up the issue.

Ken

"Michel Walsh" wrote:

> In the first one, you specify the library you want to reach, in the second
> case, you get the ListView from the first library which exposes such an
> entity, and by 'first', that means an order, and the order is the one you
> get by opening: Tools | References... (in VBE)
>
> So, if you are lucky, of if only one library exposes a ListView entity, both
> are equivalent.
>
>
>
> The problem can be seen as in the case of Recordset:
>
>
> Dim rst AS DAO.Recordset
> and
> Dim uvw AS ADODB.Recordset
> and
> Dim xzy AS Recordset
>
>
> Is xyz be a DAO recordset, or an ADO recordset is anyone guess, and may even
> change if ever your reference order changes!
>
> So, unless you are pretty sure you won't have name collision from different
> libraries, prefix with the library name.
>
>
> Vanderghast, Access MVP
>
>
> "Ken Warthen" <(E-Mail Removed)> wrote in message
> news:CE2D88A9-AD7C-45A2-B9A8-(E-Mail Removed)...
> > What is the difference between the following two declarations? Is there
> > an
> > advantage of one over the other?
> >
> > Private lvxObj as MsComctlLib.ListView
> >
> > Private lvxObj as ListView
> >
> > Ken

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with drag drop from listview to treeview control Andrew Microsoft VB .NET 0 11th Nov 2008 07:25 PM
control collection question panel + (listview + treeview + splitter) gerry.brennan@gmail.com Microsoft VC .NET 0 17th Aug 2006 12:14 PM
Multiline Listview with a TreeView control Mrin Microsoft C# .NET 0 17th Jan 2006 10:57 AM
Declaring p/invokes different ways? =?Utf-8?B?c211cmY3NQ==?= Microsoft Dot NET 2 28th Jul 2005 07:59 AM
Treeview like control in a listview (eg.. Outlook Express News Browser) Microsoft Dot NET 1 4th Sep 2003 04:57 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:07 PM.