[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 332
  • Last Modified:

ConctlLib error

Trying to compile a book sample I get an error at the top of a subroutine written as the following:

Private Sub TreeView_NodeClick(ByVal Node As ConctlLib.Node)

The components listed in the projects are are the following:

1) Microsoft Common Dialog Controls      for comdlg32.ocx

2) Microsoft Windows Common Controls 6.0 for mscomctl.ocx

with the .ocx's registered what other components are required to compile the comctlLib.Node data type?

0
optical
Asked:
optical
  • 10
  • 9
1 Solution
 
MirkwoodCommented:
Private Sub TreeView_NodeClick(ByVal Node As CoMctlLib.Node)
0
 
opticalAuthor Commented:
Yes I thank you for the solution, I typed it wrong it was to have a "m"

Private Sub TreeView_NodeClick(ByVal Node As ComctlLib.Node)
0
 
amebaCommented:
Replace: (ByVal Node As ComctlLib.Node)
with (ByVal Node As Node).
Version 6 is MSComctlLib, not ComctlLib. MS breaked its own compatibility rules by changing name.

0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
opticalAuthor Commented:
You solution in investingation, we are testing this and cannot grade it now.....
0
 
amebaCommented:
But it works, you said, error is not any more on the line you mentioned, but on the other control.
It looks like VB upgraded your controls, but you copied the old code.
Upgrade wizard does this automatic (also corrects code).
0
 
opticalAuthor Commented:

After changing the Subroutine call to
Private Sub tvData_NodeClick(ByVal Node As MSCOMCTLLIB.Node)

with an "As MSCOMCTLLIB.Node" and recieved an error at the
following function and method ".ListImages" recieved an error.

Private Sub LoadImages()
    'Specifies images used for the 2 imagelist controls
    Dim liListView As ListImage
   
    Set liListView = imSmall.ListImages.Add(, "Small", LoadPicture(SMALL_COLUMN))
    Set liListView = imLarge.ListImages.Add(, "Large", LoadPicture(LARGE_COLUMN))
   
    lvwData.Icons = imLarge
    lvwData.SmallIcons = imSmall
End Sub

////////////////////////////////////////////////

Same as instructed in the KnowledgeBase notes you sent.
    Object={831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0; MSCOMCTL.OCX

As instructed in the notes I looked for any code to

change:
           ComctlLib.ImageList
    to:
           MSComctlLib.ImageList

and there was none.  

//////////////////

After I saved the change additions to the code by text editor and
compiled the code the 'Sub LoadImages' still has an error
at ".ListImages"

      and the compiler reported "Method or Data Reference Not Found".


////////////

Please investigate this I need to see this VB6 book example work
so I can modify it and write my own code with image for a
tree view.

Thank you,
0
 
amebaCommented:
I suspect imSmall is not a legal ImageList Control.
Perhaps it is a PictureBox or version 5.
Try deleting it and add a fresh one.
0
 
amebaCommented:
Can I have URL for this example,
or you can mail it to me, so I can check or upgrade it to VB6.
0
 
opticalAuthor Commented:
Upgrade Wizard could not be found anywhere on www.microsoft.com/vbasic and its linked pages....

I will further investigate your suggestion:

 suspect imSmall is not a legal ImageList Control.
      Perhaps it is a PictureBox or version 5.
      Try deleting it and add a fresh one
as a solution..

Thank you.
0
 
amebaCommented:
ProjUpgd.EXE 154K, I can mail it to you, if you give me e-mail adr.
0
 
amebaCommented:
"ActiveX Control Upgrade Utility"
http://msdn.microsoft.com/vbasic/downloads/addon.asp
0
 
opticalAuthor Commented:
This download is to upgrade VB5 to VB6, I have version 6.0, but will try to use it anyway.
I will also try the picture control to display images.

I will email attachment the program to you, what is your address ?
0
 
amebaCommented:
See my profile (click on From:ameba)
0
 
opticalAuthor Commented:
I just emailed the source code from the book ROM, remember to change 'ctrlLib.Node' to
'MSCTRLLIB.NODE' in order to get past the first error.  Write me back, I going to test my second book.  Microsoft thinks I made out of time and money, TEN books to find two examples....ONE doesn't even work !!!


VC++ is worse try to find a drop down box example....!!!! Twenty books and I found one in the ToolBar....Who does write programs besides Microsoft ?
0
 
amebaCommented:
Form was with version 5 of controls. So I created new project, added ref. to version 5 and imported your form. When VBP and FRM version of controls match, it is easy to convert them to version 6.
0
 
opticalAuthor Commented:
Maybe its too early to work, but what do you mean "So I created new project, added ref. to version 5"  What is "ref." a reference, how can I add a refence ?

In the mean time I will try to update the controls by upgrading them using the Microsoft Active X control upgrade.
0
 
amebaCommented:
I have VB5 and VB6 on the same PC. Also, I have Common Controls version 5 and 6. In VB6 I can work with both Common Controls 5 and 6.
I started new project, added reference to Common Controls 5:
I did this via VB menu Project, Components, and in controls tab selected "Microsoft Windows Common Controls 5 (SP2)"
------
Since you do not have version 5 of Common Controls, you cannot do this.
But you can do it manualy: Open VBP file and replace line with version 5 line.

0
 
opticalAuthor Commented:
I will check that out.

With my VB6 version I have access to MS Windows Common Controls 5 (SP2) added by reference, last night I tried V6 and the three common controls ocx references.

I will try your solution also.

0
 
amebaCommented:
Thanks.
0
 
opticalAuthor Commented:
Thank you for the solution.
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 10
  • 9
Tackle projects and never again get stuck behind a technical roadblock.
Join Now