Solved

Compile Error with a lib...

Posted on 1998-12-14
12
989 Views
Last Modified: 2012-05-04
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
12 Comments
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1450142
Type ConctlLib should be ComctlLib
Private Sub TreeView_NodeClick(ByVal Node As ComctlLib.Node)

0
 

Author Comment

by:optical
ID: 1450143
Yes I know I typed it wrong.  The function has a "m"

    Private Sub TreeView_NodeClick(ByVal Node As ComctlLib.Node)
0
 
LVL 7

Expert Comment

by:Inteqam
ID: 1450144
what is the error
?

0
 
LVL 15

Expert Comment

by:ameba
ID: 1450145
If you are using Common Controls 6.0,
Replace: (ByVal Node As ComctlLib.Node)
with (ByVal Node As Node).
Version 6 is MSComctlLib.
0
 

Author Comment

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

Expert Comment

by:ameba
ID: 1450147
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 15

Expert Comment

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

Author Comment

by:optical
ID: 1450149
Still need to investigate your suggestion.

Thank you for your help.
0
 

Author Comment

by:optical
ID: 1450150

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: 1450151
Hi
0
 

Author Comment

by:optical
ID: 1450152
Yes, Fixed now.
0
 
LVL 15

Accepted Solution

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

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

707 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

20 Experts available now in Live!

Get 1:1 Help Now