Solved

ConctlLib error

Posted on 1998-12-14
20
296 Views
Last Modified: 2013-12-26
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
Comment
Question by:optical
  • 10
  • 9
20 Comments
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1488985
Private Sub TreeView_NodeClick(ByVal Node As CoMctlLib.Node)
0
 

Author Comment

by:optical
ID: 1488986
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
 
LVL 15

Expert Comment

by:ameba
ID: 1488987
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
ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

 

Author Comment

by:optical
ID: 1488988
You solution in investingation, we are testing this and cannot grade it now.....
0
 
LVL 15

Expert Comment

by:ameba
ID: 1488989
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
 

Author Comment

by:optical
ID: 1488990

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
 
LVL 15

Expert Comment

by:ameba
ID: 1488991
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
 
LVL 15

Expert Comment

by:ameba
ID: 1488992
Can I have URL for this example,
or you can mail it to me, so I can check or upgrade it to VB6.
0
 

Author Comment

by:optical
ID: 1488993
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
 
LVL 15

Expert Comment

by:ameba
ID: 1488994
ProjUpgd.EXE 154K, I can mail it to you, if you give me e-mail adr.
0
 
LVL 15

Expert Comment

by:ameba
ID: 1488995
"ActiveX Control Upgrade Utility"
http://msdn.microsoft.com/vbasic/downloads/addon.asp
0
 

Author Comment

by:optical
ID: 1488996
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
 
LVL 15

Expert Comment

by:ameba
ID: 1488997
See my profile (click on From:ameba)
0
 

Author Comment

by:optical
ID: 1488998
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
 
LVL 15

Expert Comment

by:ameba
ID: 1488999
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
 

Author Comment

by:optical
ID: 1489000
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
 
LVL 15

Expert Comment

by:ameba
ID: 1489001
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
 

Author Comment

by:optical
ID: 1489002
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
 
LVL 15

Accepted Solution

by:
ameba earned 50 total points
ID: 1489003
Thanks.
0
 

Author Comment

by:optical
ID: 1489004
Thank you for the solution.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Macro which automatically sends attachment to Outlook 14 69
VBA filters 2 61
How to incorporate an error traping routing to existing code in VB6 11 40
TT Auto Dashboard 13 92
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question