VbPowerPack

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to use the FolderViewer in VbPowerPack but it does not show
network drives nor shared folders on the network. Is there anyway to get to
act like a real control and show these items. I tried to decipher
VbPowerPack and modify it but it seems that Microsoft has to use many Com
Procedures to get it to work.

Although the FolderViewer is written in VB.Net, it uses mostly Com
objects...I wonder if Microsoft ever considered that if creating a simple
control like this requires so many com objects, maybe managed Code in the
..net framework is lacking in it's capabilities.
 
Dennis,

Beside your complain, for what I am not the best person to give you an
answer, some maybe help for your problem.

I saw your solution for the network drives, nice however the wmi classes
(which do not work on W98/Me so therefore can your solution be better) will
give you a probably better result in what you try to do and I made a sample
special for this problem, however not complete for you. You are smart enough
to know how to use it in my opinion.
------------------------------
Imports System.Management
\\\
Dim searcher As New ManagementObjectSearcher _
("SELECT * FROM Win32_LogicalDisk")
Dim ManObjOp As ManagementObject
If searcher.Get.Count > 1 Then
For Each ManObjOp In searcher.Get
Dim win32 As String = "Win32_LogicalDisk='" &
ManObjOp("Name").ToString & "'"
Dim ManObjLogD As New ManagementObject(win32)
For Each diskProperty As PropertyData In
ManObjLogD.Properties
If Not diskProperty.Value Is Nothing Then
Console.WriteLine _
("{0} = {1}", diskProperty.Name, diskProperty.Value)
End If
Next
Next
End If
///
(Probably you can use as well instead of LogicalDisk , NetworkConnection)

Than for a lot of other parts you can use
http://msdn.microsoft.com/library/d...fsystemenvironmentclassgetfolderpathtopic.asp

In a normal treeview of course,
However that where you are searching for My Neworklocations I have not
fount, so when you find that, than please let me know.

I have as well changed a little bit your code with the scripting maybe it
interest you
(I found it interesting code)

Imports IWshRuntimeLibrary
\\\By Dennis of Houston (changed a little bit by Cor Ligthert)
Dim o As IWshNetwork2 = _
CType(CreateObject("WScript.Network"), IWshNetwork2)
Dim odrives As WshCollection = CType(o.EnumNetworkDrives, WshCollection)
Dim Drives(CInt(odrives.Count / 2) - 1) As String
If odrives.Count > 0 Then
For i As Integer = 0 To odrives.Count - 1 Step 2
Drives(i) = odrives.Item(i + 0).ToString.ToLower
Next
end if
///

I hope this helps?

Cor
 
Thanks for the ideas to improve the code and thanks for the compliment about
me being smart enough to use the code...that means a lot coming from you.

I know I complain about MIcrosoft a lot but I get upset sometimes at the
incompleteness of some of their stuff. For example, they go to all the
trouble to develop .Net and managed code then when they give an example like
the VBPowerPack controls, they have to write them mostly using Com objects.

Thanks again for all the help you've given me and others on this newsgroup.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Are associated file loactions dynamic? 1
vb.net and winsock 3
System.OutOfMemoryException 9
Works in IDE, fails standalone 3
Interrupt screen saver in vb 7
Threads and DLL's 1
COM interop 1
How to show a form 3

Back
Top