• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1022
  • Last Modified:

Compile Error with a lib...

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
1 Solution
 
MirkwoodCommented:
Type ConctlLib should be ComctlLib
Private Sub TreeView_NodeClick(ByVal Node As ComctlLib.Node)

0
 
opticalAuthor Commented:
Yes I know I typed it wrong.  The function has a "m"

    Private Sub TreeView_NodeClick(ByVal Node As ComctlLib.Node)
0
 
InteqamCommented:
what is the error
?

0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
amebaCommented:
If you are using Common Controls 6.0,
Replace: (ByVal Node As ComctlLib.Node)
with (ByVal Node As Node).
Version 6 is MSComctlLib.
0
 
opticalAuthor Commented:
(ByVal Node As Node) this is what I also tried, the compiler passed this, but when a subrountine for images the ".listimage" method failed.
0
 
amebaCommented:
Well, do the same thing.
Search your project for ComctlLib, and remove or replace with MSComctlLib.
Or you can download upgrade wizard from owners area.
Or I can send you instructions for manually upgrading from version 5 to 6.
0
 
amebaCommented:
HOWTO: Upgrade Project to Use the New MSCCOMCTL.OCX in VB6
Last reviewed: August 7, 1998
Article ID: Q190952
------------------------------------------------------------------------
The information in this article applies to:
Microsoft Visual Basic Learning, Professional, and Enterprise Editions for
Windows, version 6.0
SUMMARY
The following controls are not automatically updated when a Visual Basic
5.0 project is loaded by Visual Basic 6.0:
   COMCLTL32.OCX, COMCT232.OCX, and MSCHART.OCX
The project must be manually upgraded to the new Visual Basic 6.0 controls:
MSCOMCTL.OCX, MSCOMCT2.OCX, and MSCHRT20.OCX, respectively.
MORE INFORMATION
The new controls are not backward compatible with the older versions and,
in accordance with the rules of COM, were given new file names and new
GUIDs. This prevents your application from breaking existing applications
that use the older controls. Because the new controls have new names and
GUIDs, they also have new Typelibs. When you load a Visual Basic project,
it checks the Typelib version. However, Visual Basic does not know the
Controls were updated because the Typelib for the new controls have a
different GUID than the Typelib for the old controls.
To upgrade a project to the newer version, you must do the following:
1.Open the VBP file in a text editor, such as Notepad, and change the
line(s) that reference the old version of the OCX to the following:

Object={831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0; MSCOMCTL.OCX
Object={86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0; MSCOMCT2.OCX
Object={65E121D4-0C60-11D2-A9FC-0000F8754DA1}#2.0#0; MSCHRT20.OCX

Save and close the VBP file.
2.Open any FRM file (or CTL file) that uses one of the above controls in a
text editor, and change the line(s) that reference the old version of the
OCX to the following:

Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Object = "{65E121D4-0C60-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCHRT20.OCX"

3.Change all text that references the old libraries to the new library
names. This means that you need to replace ComCtlLib, Comctl2, and
MSChartLib with MSComCtlLib, MSComCtl2, and MSChart20Lib. For example,
change:
       ComctlLib.ImageList
to:
       MSComctlLib.ImageList
4.Save and close the file. When you open the project in Visual Basic 6.0,
it will use the new MSCOMCTL.OCX, MSCOMCT2.OCX and/or MSCHRT20.OCX
controls.
NOTE:
1.IMPORTANT: Before you edit your VBP, FRM, or CTL files, you should backup
all of the files in your project.
2.While the objects listed in step 1 and 2 are very similar, they are not
identical and the upgrade will not work properly if each is not copied
exactly to the correct file.
3.If you get a message stating that the header is corrupt when you attempt
to load the project, you have probably made a copy error. Please go to your
backup and repeat the process.
4.If you prefer to continue using the older versions of these controls,
comctl32.ocx and comct232.ocx are included on the Visual Basic 6.0 product
CD-ROM in the \OS\System directory. Mschart32.ocx resides in the
\Common\Tools\VB\Controls directory.

0
 
opticalAuthor Commented:
Still need to investigate your suggestion.

Thank you for your help.
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:
Hi
0
 
opticalAuthor Commented:
Yes, Fixed now.
0
 
amebaCommented:
Thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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