MSComctlLib.ocx vs MSComctlLib.oca? 
Author Message
 MSComctlLib.ocx vs MSComctlLib.oca?

I'm a bit of a newbie at VB so please excuse my ignorance.
I've inherited this program that uses the Treeview control. It refers to an
object called Node, which is missing. Looking at the Object Browser it tells
me that the Node object comes from MSComctlLib.oca. MSComctlLib.oca isn't
available in the Components list but the ocx version is. I tried adding
MSComctlLib.oca in the Components list but VB says it isn't registerable as
an ActiveX component. When I try to add it to the References list, it says
"Can't Remove Control or reference in use" and if I press OK, it says "Name
conflicts with existing module, project or object library".

What can I do to make it run?

I've tried removing the control and re-entering it but I got an error
"ImageList must be initialized before it can be used. Source: TreeCtrl" so I
guess the two controls are not totally compatible (the previous control had
icons of people at the nodes as well as the text "Sample Node", while the
re-inserted version only has the text. I assume the re-inserted one is from
the ocx version of MSComctlLib)

Can anyone help?

Thanks.



Sun, 25 Jan 2004 15:41:44 GMT  
 MSComctlLib.ocx vs MSComctlLib.oca?
I'm a bit of a newbie at VB so please excuse my ignorance.
I've inherited this program that uses the Treeview control. It refers to an
object called Node, which is missing. Looking at the Object Browser it tells
me that the Node object comes from MSComctlLib.oca. MSComctlLib.oca isn't
available in the Components list but the ocx version is. I tried adding
MSComctlLib.oca in the Components list but VB says it isn't registerable as
an ActiveX component. When I try to add it to the References list, it says
"Can't Remove Control or reference in use" and if I press OK, it says "Name
conflicts with existing module, project or object library".

What can I do to make it run?

I've tried removing the control and re-entering it but I got an error
"ImageList must be initialized before it can be used. Source: TreeCtrl" so I
guess the two controls are not totally compatible (the previous control had
icons of people at the nodes as well as the text "Sample Node", while the
re-inserted version only has the text. I assume the re-inserted one is from
the ocx version of MSComctlLib)

Can anyone help?

Thanks.



Sun, 25 Jan 2004 15:42:00 GMT  
 MSComctlLib.ocx vs MSComctlLib.oca?
An OCA is simply a "cache" for the OCX file itself.  Among other data, the
OCA contains the type library information for the OCX file.  You cannot
directly add an OCA file to you project.  You must add the OCX file via the
Components dialog box.  If there is no corresponding OCA file for that OCX,
VB automatically creates the OCA file.  Object browser is listing the OCA
because that's where it's getting the type library information from.  While
you can add an OCA file via the References dialog box, this will ONLY
provide VB with the type library information.  You're getting the naming
conflict error because you've probably already added the OCX file to the
toolbox; therefore, the type library information is already loaded in
memory.

As far as the error you're getting about the ImageList not being
initialized.....if you're displaying icons for any of the TreeView's Nodes,
those icons come from an ImageList control.  The ImageList must be "bound"
to the Treeview.  You can do this at design time or runtime.  At
design-time, right-click the TreeView and select Properties.  On the General
tab, select the ImageList control from the ImageList dropdown box.  At
runtime, assign the Imagelist control to the TreeView's ImageList property
using the Set statement.  For example:

Set TreeView1.ImageList = ImageList1

It also kind of sounds like the original program might have used the VB5
version of Windows Common Controls (which includes the TreeView and
ImageList controls), but you've added the VB6 version of Windows Common
Controls.  These are not binary compatible with each other for reasons I
won't bore you with. What this means is that you cannot directly upgrade the
VB5 version with the VB6 version (IOW, you can't simply remove the VB5
control and replace it with the VB6 control).  However, MS does provide a
utility to change all object references to the VB6 version.  See the
following KB article for more information and to download this utility (if
this is indeed one of the problems you're having).

FILE: PROJUPDG.EXE VB 6.0 ActiveX Control Upgrade Utility
Article ID: Q194412
http://support.microsoft.com/support/kb/articles/Q194/4/12.ASP

Mike


Quote:
> I'm a bit of a newbie at VB so please excuse my ignorance.
> I've inherited this program that uses the Treeview control. It refers to
an
> object called Node, which is missing. Looking at the Object Browser it
tells
> me that the Node object comes from MSComctlLib.oca. MSComctlLib.oca isn't
> available in the Components list but the ocx version is. I tried adding
> MSComctlLib.oca in the Components list but VB says it isn't registerable
as
> an ActiveX component. When I try to add it to the References list, it says
> "Can't Remove Control or reference in use" and if I press OK, it says
"Name
> conflicts with existing module, project or object library".

> What can I do to make it run?

> I've tried removing the control and re-entering it but I got an error
> "ImageList must be initialized before it can be used. Source: TreeCtrl" so
I
> guess the two controls are not totally compatible (the previous control
had
> icons of people at the nodes as well as the text "Sample Node", while the
> re-inserted version only has the text. I assume the re-inserted one is
from
> the ocx version of MSComctlLib)

> Can anyone help?

> Thanks.



Mon, 26 Jan 2004 09:08:35 GMT  
 MSComctlLib.ocx vs MSComctlLib.oca?
Thank you very much, Mike. You have given me some things to check for.

--
Mike Bliv


Quote:
> An OCA is simply a "cache" for the OCX file itself.  Among other data, the
> OCA contains the type library information for the OCX file.  You cannot
> directly add an OCA file to you project.  You must add the OCX file via
the
> Components dialog box.  If there is no corresponding OCA file for that
OCX,
> VB automatically creates the OCA file.  Object browser is listing the OCA
> because that's where it's getting the type library information from.
While
> you can add an OCA file via the References dialog box, this will ONLY
> provide VB with the type library information.  You're getting the naming
> conflict error because you've probably already added the OCX file to the
> toolbox; therefore, the type library information is already loaded in
> memory.

> As far as the error you're getting about the ImageList not being
> initialized.....if you're displaying icons for any of the TreeView's
Nodes,
> those icons come from an ImageList control.  The ImageList must be "bound"
> to the Treeview.  You can do this at design time or runtime.  At
> design-time, right-click the TreeView and select Properties.  On the
General
> tab, select the ImageList control from the ImageList dropdown box.  At
> runtime, assign the Imagelist control to the TreeView's ImageList property
> using the Set statement.  For example:

> Set TreeView1.ImageList = ImageList1

> It also kind of sounds like the original program might have used the VB5
> version of Windows Common Controls (which includes the TreeView and
> ImageList controls), but you've added the VB6 version of Windows Common
> Controls.  These are not binary compatible with each other for reasons I
> won't bore you with. What this means is that you cannot directly upgrade
the
> VB5 version with the VB6 version (IOW, you can't simply remove the VB5
> control and replace it with the VB6 control).  However, MS does provide a
> utility to change all object references to the VB6 version.  See the
> following KB article for more information and to download this utility (if
> this is indeed one of the problems you're having).

> FILE: PROJUPDG.EXE VB 6.0 ActiveX Control Upgrade Utility
> Article ID: Q194412
> http://support.microsoft.com/support/kb/articles/Q194/4/12.ASP

> Mike



> > I'm a bit of a newbie at VB so please excuse my ignorance.
> > I've inherited this program that uses the Treeview control. It refers to
> an
> > object called Node, which is missing. Looking at the Object Browser it
> tells
> > me that the Node object comes from MSComctlLib.oca. MSComctlLib.oca
isn't
> > available in the Components list but the ocx version is. I tried adding
> > MSComctlLib.oca in the Components list but VB says it isn't registerable
> as
> > an ActiveX component. When I try to add it to the References list, it
says
> > "Can't Remove Control or reference in use" and if I press OK, it says
> "Name
> > conflicts with existing module, project or object library".

> > What can I do to make it run?

> > I've tried removing the control and re-entering it but I got an error
> > "ImageList must be initialized before it can be used. Source: TreeCtrl"
so
> I
> > guess the two controls are not totally compatible (the previous control
> had
> > icons of people at the nodes as well as the text "Sample Node", while
the
> > re-inserted version only has the text. I assume the re-inserted one is
> from
> > the ocx version of MSComctlLib)

> > Can anyone help?

> > Thanks.



Mon, 26 Jan 2004 14:49:10 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. MSComctlLib error loading project in VB 6

2. MSComctlLib error loading project in VB 6

3. MSComctlLib.TreeCtrl.2 tvwSets question

4. ********* The problems you can have using Dim with NEW and VB 6.0 MSComctlLib service pack 3

5. Type mismatch vs. OCA files

6. reference (.dll) vs. componen t(.oca)

7. TreeView ? How create a Reference as MSComctlLib.Node ?

8. MSComctlLib & MSComCtl2...WHATS IT FOR???

9. OCX registering... and OCA

10. OCA/OCX/Visual Basic 6.0 problem

11. Difference between ocx and oca

12. help : OCX/OCA/ missing reference

 

 
Powered by phpBB® Forum Software