Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  HOME    TRACKER    Visual Basic


Where can i find a reference/explanation about MSComctlLib?
I've started at but there are nothing. Even the reference guide has "DataObject" where normally we found MSComctlLib.Property in VB parameters, eg. OLEDragDrop TreeView event.

View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
MSComctlLib ProgressBar
I needed a progress bar. I went to View!Toolbars!Control Toolbox!More Controls!Microsoft ProgressBar Control, version 5.0 (SP2).

I draw it on the screen.

Now what? It shows up nowhere in my module autocomplete selection list when I type "ComctlLib." (It's in the Object Browser as belonging to that.)

How do I use the control if its default name ProgressBar1 is perceived by VBA to be a variable?

The picture of the progress bar looks nice on my spreadsheet, but I can't use it without being able to use the object. Why is there no way to get the object into my statements? Is it just a picture of something? Or can you actually program it?

I use Microsoft Treeview Control 6.0 (SP6) in both Excel and Access. In Excel I can see the properties/methods in the VBA using Ctrl+J (or Ctrl+Space) but in Access I get the wrong list of methods/properties, e.g. properties is missing, and those viewed in the list doesn't exist. Why, and how can I solve this?

I've Uh, Broken Something...MSComctlLib
So I used the Package and deployment wizrd to generate an installation routine for a test app. I foolishly told it NOT to mark some files as shared, and when I uninstalled it, it apparently removed some files that VB needs to run my project.

this line of code:

Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)

generates an error that says:

"Project or Library not found"

and then nuttin, el Stoppo. I've tried re-installing VB6, no joy there.

Am I hosed?

Lost Reference To Mscomctllib!!
I have recently saved and recompiled a vb program which worked fine. when i re-open the project in vb however, there are errors during the load and i get the following message in a log file:

Line 54: Class MSComctlLib.ListView of control lvExtractTables was not a loaded control class.

when i look at the listview in the designer, it says it is a picturebox?! i seem to have lost my reference to mscomctllib so that none of the common controls are recognised? anyone know how to fix / why it happened?


gareth jones

Error With MSComctlLib Components
Hi I have worked on a system for about 4 months now and are using the list view of mscomctl.ocx and other components from mscomct2.

Now all of a sudden I get a compile error: User defined datatype not defined on Private Sub lvSelect_ColumnClick(ByVal ColumnHeader As MSComctlLib.ColumnHeader)

Can annyone please help?


MSComctlLib.DataObject (Drag && Drop)
Oh boy.. how am I gonna explain this.... Ummm. OK. I have three custom controls, 2 contain datatables and we'll call these custom controlls Datatable 'A' and Datatable 'B' (the datatable controls they contain are made by infragistics (DataTable8)) and one contains a TreeView.

Datatable 'A's job is to display a manifest of objects which belong to any selected node in the tree. Imagine that tree nodes represent shipping containers, clicking on one of them would result in table 'A' displaying the contents of that container. Easy enough.
Datatable 'B' contains things that can be added to nodes in the tree. Dragging a row from Datatable 'B' to a node in the tree adds that item to that node. If the user has the node they dragged to as the selected node, then Datatable 'A' will refresh and display the newly added item.
From the users standpoint it also makes sense to drag items from Datatable 'B' to Datatable 'A', but adding things to nodes in the tree is really outside the scope of Datatable 'A' so what to do?
The solution that presented itself was to do a 'remote' data drop, in other words have Datatable 'A' echo the data object that was dropped on it (which is of type PVDataTable5.IDTDataObject) back to the Tree via a public Sub in the Tree called 'RemoteDataDrop'. This public sub would push the DataObject to the OLDDragDrop of the tree where it could be processed just as if the item was dropped from Datatable 'B' itself. As you might have guessed, this is where the problem comes in.
Data Type Mismatch.
OK, the next idea was to create a variable of type MSComctlLib.Dataobject and the add items from the object of type PVDataTable5.IDTDataObject to it. Both types have the same methods and both types can have their data extracted as vbcftext items so therefore this should be a way of transferring the data between objects of differing types. Problem is the following;

DIM X As MSComctllib.Dataobject

is perfectly valid but

DIM X As New MSComctllib.Dataobject

Is not, and you will get an 'object or with block variable not defined' (or an error to that effect) if it is only DIMensioned. Anybody got a way around this? Anyone got an alternative suggestion? Any and all help is appreciated.

Looking For Object With ProgID: MSComctlLib.ImageListCtrl.2
Hi All,

I have a user getting "Looking for object with ProgID: MSComctlLib.ImageListCtrl.2" when he runs my program. He's running Win2k.

The only image list I'm using is vbAccelerator's image list (vbaliml6.ocx).

Does this error mean that something else I'm using needs MS' image list control, but that it's not installed on his system?

I'm lost.


Bret Reece

ListView1_ItemCheck(ByVal Item As MSComctlLib.ListItem)
Hey all, ListView1

Below sub is used to check if an item in the listview has been clicked on or off with the checkbox feature of the listview enabled.

ListView1_ItemCheck(ByVal item As MSComctlLib.ListItem)

ByVal item As MSComctlLib.ListItem refers to the text of the first listview column.

Is their a way to access the above sub by listindex instead?
As the contents of the listview may change and leave my program without any way of identifying item As MSComctlLib.ListItem?

Any help appreciated Thanks

Type Mismatch With MSComctlLib.TreeView In Special Case.

I have a really strange problem regarding the usage of MSComctlLib.TreeView and a selfmade ActiveX-dll library.
I searched the forum, but there is so much around TreeView problems here, not regarding my situation that I decided to write this post.

I created an VB6 ActiveX-dll library which cointains just this one class:

MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
Attribute VB_Name = "Tree"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit
Option Compare Text

Private WithEvents objTree As MSComctlLib.TreeView
Attribute objTree.VB_VarHelpID = -1

Public Property Set Tree(parObjTree As Object)
Set objTree = parObjTree
End Property

Public Property Get Tree() As Object
Set Tree = objTree
End Property
Aditionally I referenced the component "mscomctl.ocx" in this project.
Info: I need to use "WithEvents", because I have to catch the events of the object.

Then I made a VB6 client application (standard EXE) which also referenced this "mscomctl.ocx" component.
In the form I placed a tree-object ("uxTreeView") and a button:

Private Sub uxCommandStoreInLib_Click()
Dim objLibTree As New Lib.Tree

Set objLibTree.Tree = uxTreeView

MsgBox objLibTree.Tree.Name
End Sub

This runs perfect, as long as I use the binaries from my computer.
When I copy the DLL and the EXE to another computer, register the DLL and run the EXE, all is still fine.

But when I open my client-EXE-Project on the second computer, nothing works any more.
I get a type-mismatch error in this line:
Set objLibTree.Tree = uxTreeView
I need a reference to my 'clients' treeview in my Lib.
And the usage of the datatype "Object" for 'objTree' in the Lib is not possible because of "WithEvents".

Where does this behaviour come from?
What ca I do?
Does anybody have an idea?


If wanted, I can provide the full code sample.

Compile Error: User Defined Datatype For MSComctlLib
Rebuild the Project file and it worked. this one was strange for all the referances was still there but not working. Well hope this will help someone....

Hi I have worked on a system for about 4 months now and are using the list view of mscomctl.ocx and other components from mscomct2.

Now all of a sudden I get a compile error: User defined datatype not defined on Private Sub lvSelect_ColumnClick(ByVal ColumnHeader As MSComctlLib.ColumnHeader)
Can annyone please help?


Listview.Add No Longer Recognize? Listview.mscomctllib Instead?
So I hadn't done some Vbasic coding in like a month. Then i go to edit my code and find the debugger throwing an error on my listview.add.

I delete the .add and hit the . key to see what the supported methods are and it only shows "MSComctlLib" as my option. But then it throws an error when i try to select that. How did this happen and more importantly how do I get back to normal listview methods?

The Difference Between X As Node And X As MSComctlLib.Node
I have seen both of these declarations used when declaring nodes:
Dim nodX As Node
dim nodX As MSComctlLib.Node
Which one is the "right" way?

God Bless America

MSComctlLib.Listitem And Listitem
What's the difference between declaring an object as MSComctlLib.object and as object itself?

Let me clarify this with the following:
dim liListitem as ListItem
dim liListitem as MSComctlLib.ListItem


Copyright 2005-08, All rights reserved