Home All Groups Group Topic Archive Search About

Adding treeview programacticlly

Author
23 Mar 2006 12:44 AM
Dan Reber
I am adding a treeview control programmatically to an ActiveX control using
the Prog ID of 'MSComctlLib.TreeCtrl.2'.  This works fine on Windows 98, NT,
2000 and XP but it does not work  on Windows 2003.  I already tried
'MSComctlLib.TreeCtrl' and that works on 2000 and XP  (I don't have 98 or NT
to test) but not on 2003.  Is there some other value that I need to specify?

Thanks

Dan

Author
23 Mar 2006 5:04 AM
Ken Halter
"Dan Reber" <dreber@nospam.com> wrote in message
news:u2DyqLhTGHA.2276@tk2msftngp13.phx.gbl...
>I am adding a treeview control programmatically to an ActiveX control using
>the Prog ID of 'MSComctlLib.TreeCtrl.2'.  This works fine on Windows 98,
>NT, 2000 and XP but it does not work  on Windows 2003.  I already tried
>'MSComctlLib.TreeCtrl' and that works on 2000 and XP  (I don't have 98 or
>NT to test) but not on 2003.  Is there some other value that I need to
>specify?
>
> Thanks
>
> Dan

Are you creating a setup package for the app?

--
Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
DLL Hell problems? Try ComGuard - http://www.vbsight.com/ComGuard.htm
Author
23 Mar 2006 12:37 PM
Dan Reber
Yes I am, I am using Wise for Windows Installer

Show quoteHide quote
"Ken Halter" <Ken_Halter@Use_Sparingly_Hotmail.com> wrote in message
news:ubO0vdjTGHA.1576@tk2msftngp13.phx.gbl...
> "Dan Reber" <dreber@nospam.com> wrote in message
> news:u2DyqLhTGHA.2276@tk2msftngp13.phx.gbl...
>>I am adding a treeview control programmatically to an ActiveX control
>>using the Prog ID of 'MSComctlLib.TreeCtrl.2'.  This works fine on Windows
>>98, NT, 2000 and XP but it does not work  on Windows 2003.  I already
>>tried 'MSComctlLib.TreeCtrl' and that works on 2000 and XP  (I don't have
>>98 or NT to test) but not on 2003.  Is there some other value that I need
>>to specify?
>>
>> Thanks
>>
>> Dan
>
> Are you creating a setup package for the app?
>
> --
> Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
> DLL Hell problems? Try ComGuard - http://www.vbsight.com/ComGuard.htm
>
Author
23 Mar 2006 12:58 PM
Dan Reber
I you are wondering if MSComctlLib.ocx is installed on the Windows 2003
server then yes it is but the version I am using is from 2002 and the one
that is on the server is from 2004.

Dan

Show quoteHide quote
"Dan Reber" <dreber@nospam.com> wrote in message
news:OQoEbanTGHA.5900@tk2msftngp13.phx.gbl...
> Yes I am, I am using Wise for Windows Installer
>
> "Ken Halter" <Ken_Halter@Use_Sparingly_Hotmail.com> wrote in message
> news:ubO0vdjTGHA.1576@tk2msftngp13.phx.gbl...
>> "Dan Reber" <dreber@nospam.com> wrote in message
>> news:u2DyqLhTGHA.2276@tk2msftngp13.phx.gbl...
>>>I am adding a treeview control programmatically to an ActiveX control
>>>using the Prog ID of 'MSComctlLib.TreeCtrl.2'.  This works fine on
>>>Windows 98, NT, 2000 and XP but it does not work  on Windows 2003.  I
>>>already tried 'MSComctlLib.TreeCtrl' and that works on 2000 and XP  (I
>>>don't have 98 or NT to test) but not on 2003.  Is there some other value
>>>that I need to specify?
>>>
>>> Thanks
>>>
>>> Dan
>>
>> Are you creating a setup package for the app?
>>
>> --
>> Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
>> DLL Hell problems? Try ComGuard - http://www.vbsight.com/ComGuard.htm
>>
>
>
Author
23 Mar 2006 1:05 PM
Dan Reber
I meant MSCOMCTL.OCX. is installed.

Show quoteHide quote
"Dan Reber" <dreber@nospam.com> wrote in message
news:ejcpVmnTGHA.4864@TK2MSFTNGP12.phx.gbl...
>I you are wondering if MSComctlLib.ocx is installed on the Windows 2003
>server then yes it is but the version I am using is from 2002 and the one
>that is on the server is from 2004.
>
> Dan
>
> "Dan Reber" <dreber@nospam.com> wrote in message
> news:OQoEbanTGHA.5900@tk2msftngp13.phx.gbl...
>> Yes I am, I am using Wise for Windows Installer
>>
>> "Ken Halter" <Ken_Halter@Use_Sparingly_Hotmail.com> wrote in message
>> news:ubO0vdjTGHA.1576@tk2msftngp13.phx.gbl...
>>> "Dan Reber" <dreber@nospam.com> wrote in message
>>> news:u2DyqLhTGHA.2276@tk2msftngp13.phx.gbl...
>>>>I am adding a treeview control programmatically to an ActiveX control
>>>>using the Prog ID of 'MSComctlLib.TreeCtrl.2'.  This works fine on
>>>>Windows 98, NT, 2000 and XP but it does not work  on Windows 2003.  I
>>>>already tried 'MSComctlLib.TreeCtrl' and that works on 2000 and XP  (I
>>>>don't have 98 or NT to test) but not on 2003.  Is there some other value
>>>>that I need to specify?
>>>>
>>>> Thanks
>>>>
>>>> Dan
>>>
>>> Are you creating a setup package for the app?
>>>
>>> --
>>> Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
>>> DLL Hell problems? Try ComGuard - http://www.vbsight.com/ComGuard.htm
>>>
>>
>>
>
>
Author
23 Mar 2006 4:16 PM
Ken Halter
"Dan Reber" <dreber@nospam.com> wrote in message
news:ejcpVmnTGHA.4864@TK2MSFTNGP12.phx.gbl...
>I you are wondering if MSComctlLib.ocx is installed on the Windows 2003
>server then yes it is but the version I am using is from 2002 and the one
>that is on the server is from 2004.
>
> Dan

hmmm.... well, I started a brand new Win2003 server (on Virtual PC) and
tried running this without a setup package. Error said there was no such ocx
(mscomctl.ocx). After installing one of our packages that installs the OCX,
this ran fine.
'========
Private Sub Form_Load()
   On Error GoTo ErrorTrap

   With Controls.Add("MSComctlLib.TreeCtrl.2", "Test")
      .Move 0, 0, ScaleWidth, ScaleHeight
      .Visible = True
      .ZOrder
   End With

Terminate:
   Exit Sub

ErrorTrap:
   MsgBox "Error Number: " & Err.Number & vbCrLf & "Error Desc: " &
Err.Description
   Resume Terminate
End Sub
'========

This page shows that you're probably using the SP6 version....
http://support.microsoft.com/dllhelp/?dlltype=file&l=55&alpha=MSCOMCTL.OCX&S=1

So... I installed the Hotfix below to see if that was causing the
problem....

FIX: The Windows Common Controls Mscomctl.ocx or Comctl32.ocx may cause your
application or the Visual Basic 6 IDE to unexpectedly quit, or you may
receive a "Divide By Zero" error message
http://support.microsoft.com/?kbid=896559

Nope. Still works.

--
Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
DLL Hell problems? Try ComGuard - http://www.vbsight.com/ComGuard.htm
Author
23 Mar 2006 5:59 PM
Dan Reber
Interesting...I went to the registry and MSComctlLib.TreeCtrl.2 is located
under both HKEY_CLASES_ROOT and HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID
with the proper path under InprocServer32.

The CLASID listed in HKEY_CLASES_ROOT  points to the correct value in
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID.

And what is strange is that I just tested this on other Windows 2003
servers and it works fine.

Dan



Show quoteHide quote
"Ken Halter" <Ken_Halter@Use_Sparingly_Hotmail.com> wrote in message
news:e$e4WUpTGHA.4080@TK2MSFTNGP10.phx.gbl...
> "Dan Reber" <dreber@nospam.com> wrote in message
> news:ejcpVmnTGHA.4864@TK2MSFTNGP12.phx.gbl...
>>I you are wondering if MSComctlLib.ocx is installed on the Windows 2003
>>server then yes it is but the version I am using is from 2002 and the one
>>that is on the server is from 2004.
>>
>> Dan
>
> hmmm.... well, I started a brand new Win2003 server (on Virtual PC) and
> tried running this without a setup package. Error said there was no such
> ocx (mscomctl.ocx). After installing one of our packages that installs the
> OCX, this ran fine.
> '========
> Private Sub Form_Load()
>   On Error GoTo ErrorTrap
>
>   With Controls.Add("MSComctlLib.TreeCtrl.2", "Test")
>      .Move 0, 0, ScaleWidth, ScaleHeight
>      .Visible = True
>      .ZOrder
>   End With
>
> Terminate:
>   Exit Sub
>
> ErrorTrap:
>   MsgBox "Error Number: " & Err.Number & vbCrLf & "Error Desc: " &
> Err.Description
>   Resume Terminate
> End Sub
> '========
>
> This page shows that you're probably using the SP6 version....
> http://support.microsoft.com/dllhelp/?dlltype=file&l=55&alpha=MSCOMCTL.OCX&S=1
>
> So... I installed the Hotfix below to see if that was causing the
> problem....
>
> FIX: The Windows Common Controls Mscomctl.ocx or Comctl32.ocx may cause
> your application or the Visual Basic 6 IDE to unexpectedly quit, or you
> may receive a "Divide By Zero" error message
> http://support.microsoft.com/?kbid=896559
>
> Nope. Still works.
>
> --
> Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
> DLL Hell problems? Try ComGuard - http://www.vbsight.com/ComGuard.htm
>
Author
23 Mar 2006 8:35 PM
Bob Butler
"Dan Reber" <dreber@nospam.com> wrote in message
news:eloJCOqTGHA.4436@TK2MSFTNGP10.phx.gbl
> Interesting...I went to the registry and MSComctlLib.TreeCtrl.2 is
> located under both HKEY_CLASES_ROOT and
> HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID with the proper path under
> InprocServer32.
>
> The CLASID listed in HKEY_CLASES_ROOT  points to the correct value in
> HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID.

HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES *IS* HKEY_CLASSES_ROOT

The latter is just a "shortcut" to the same registry key

--
Reply to the group so all can participate
VB.Net: "Fool me once..."
Author
23 Mar 2006 6:36 PM
Dan Reber
I created an app with just the following code

Set o = Controls.Add("MSComctlLib.TreeCtrl.2", "o")
   With o
      .Move 0, 0, Me.ScaleWidth, Me.ScaleHeight
      .Visible = True
   End With

and it works fine.  I guess that I have to deal with the ActiveX control
vendor now.

Thanks for your help.

Dan



Show quoteHide quote
"Ken Halter" <Ken_Halter@Use_Sparingly_Hotmail.com> wrote in message
news:e$e4WUpTGHA.4080@TK2MSFTNGP10.phx.gbl...
> "Dan Reber" <dreber@nospam.com> wrote in message
> news:ejcpVmnTGHA.4864@TK2MSFTNGP12.phx.gbl...
>>I you are wondering if MSComctlLib.ocx is installed on the Windows 2003
>>server then yes it is but the version I am using is from 2002 and the one
>>that is on the server is from 2004.
>>
>> Dan
>
> hmmm.... well, I started a brand new Win2003 server (on Virtual PC) and
> tried running this without a setup package. Error said there was no such
> ocx (mscomctl.ocx). After installing one of our packages that installs the
> OCX, this ran fine.
> '========
> Private Sub Form_Load()
>   On Error GoTo ErrorTrap
>
>   With Controls.Add("MSComctlLib.TreeCtrl.2", "Test")
>      .Move 0, 0, ScaleWidth, ScaleHeight
>      .Visible = True
>      .ZOrder
>   End With
>
> Terminate:
>   Exit Sub
>
> ErrorTrap:
>   MsgBox "Error Number: " & Err.Number & vbCrLf & "Error Desc: " &
> Err.Description
>   Resume Terminate
> End Sub
> '========
>
> This page shows that you're probably using the SP6 version....
> http://support.microsoft.com/dllhelp/?dlltype=file&l=55&alpha=MSCOMCTL.OCX&S=1
>
> So... I installed the Hotfix below to see if that was causing the
> problem....
>
> FIX: The Windows Common Controls Mscomctl.ocx or Comctl32.ocx may cause
> your application or the Visual Basic 6 IDE to unexpectedly quit, or you
> may receive a "Divide By Zero" error message
> http://support.microsoft.com/?kbid=896559
>
> Nope. Still works.
>
> --
> Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
> DLL Hell problems? Try ComGuard - http://www.vbsight.com/ComGuard.htm
>