Solved

ConctlLib error

Posted on 1998-12-14
20
290 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
 

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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now