Page 1 of 2 12>
Topic Options
#157500 - 2006-02-21 02:53 PM AD Explorer by Chris S.
kirkside Offline
Getting the hang of it

Registered: 2006-01-19
Posts: 52
Loc: UK
i am playing with the AD Explorer that Chris S. came up with. I am making a few modifications to it, but one simple question (to start with anyway), how do add the Computer Disabled icon to it. The user disabled icon was added some time ago, but no Computer. Cheers.
Top
#157501 - 2006-02-21 03:06 PM Re: AD Explorer by Chris S.
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
There is a Computer Disabled icon.
Top
#157502 - 2006-02-21 03:10 PM Re: AD Explorer by Chris S.
kirkside Offline
Getting the hang of it

Registered: 2006-01-19
Posts: 52
Loc: UK
Unless I have the wrong version, there is not disabled icon. Disabled computer accounts show up the same as the enabled accounts. Below is the bit of code that mentions the icons.

Code:
  
If Exist("%WINDIR%\System32\dsuiext.dll")
$c=$imgList.Images.Add("dsuiext.dll;1")
$g=$imgList.Images.Add("dsuiext.dll;7")
$u=$imgList.Images.Add("dsuiext.dll;12")
$o=$imgList.Images.Add("dsuiext.dll;13")
$ux=$imgList.Images.Add("dsuiext.dll;27")
$ul=$imgList.Images.Add(".\user_locked_16.ico")
$f=$imgList.Images.Add("dsquery.dll;0")
$frmMain.Icon = $imgList.Images($f)


Top
#157503 - 2006-02-21 06:42 PM Re: AD Explorer by Chris S.
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
here is a slightly modified ver of Chris's 'AD Browser', run it, click edit, click view icons, and you will see all of the icons Chris has included in his script. you will see that the disabled computer icon is second in the image strip.
Code:

Break On

$=SetOption("Explicit","On")

Global $System,$Form,$MessageBox1,$ImageList1,$IconForm,$IconLabel

;region === KiXforms Region ===============================================

$System = CreateObject("Kixtart.System")

;region === MessageBox ====================================================
$MessageBox1 = $System.MessageBox()
$MessageBox1.Title = "Information..."
$MessageBox1.Style = 68
;endregion

;region === ImageList =====================================================
$ImageList1 = $System.ImageList
$ImageList1.ImageSize = 16,16
$ImageList1.TransparentColor = 255,0,255
$ImageList1.AddStrip($System.Bitmap.FromBase64String(fnBitmapStrip()))
;endregion

;region === Main Form =====================================================
$Form = $System.Form()
$Form.DockPadding = 1,1,1,1

$Form.Icon = $ImageList1.Images(9)
$Form.FontName = "Tahoma"
$Form.Size = 800,600
$Form.Center()
;endregion

;region === Clipboard =====================================================
$Form.Clipboard1 = $Form.Controls.TextBox("",0,0,0,0)
$Form.Clipboard1.Hide
;endregion

;region === Menus =========================================================
$Form.Menu = $System.MainMenu()

;region === File Menu =====================================================
$Form.FileMenu = $Form.Menu.MenuItems.Add("&File")

$Form.FileMenu.ExitApp = $Form.FileMenu.MenuItems.Add("Exit")
$Form.FileMenu.ExitApp.OnClick = "Quit()"
;endregion

;region === Edit Menu =====================================================
$Form.EditMenu = $Form.Menu.MenuItems.Add("&Edit")

$Form.EditMenu.CopyADsPath = $Form.EditMenu.MenuItems.Add("Copy ADsPath of Current Container")
$Form.EditMenu.CopyADsPath.OnClick = "fnCopy()"

$Form.EditMenu.ViewIcons = $Form.EditMenu.MenuItems.Add("View Icons")
$Form.EditMenu.ViewIcons.OnClick = "fnView()"
;endregion

;endregion

;region === Toolbar =======================================================
$Form.ToolGroupBox = $Form.Controls.GroupBox()
$Form.ToolGroupBox.Height = 30
$Form.ToolGroupBox.Dock = 1

$Form.UpButton = $Form.ToolGroupBox.ToolButton("",2,2,26,26)
$Form.UpButton.FlatStyle = 1
$Form.UpButton.Icon = 47
$Form.UpButton.OnClick = "fnOnUp()"
$Form.UpButton.ToolTipText = "Up One Level"

$Form.Console = $Form.ToolGroupBox.ToolButton("",$Form.UpButton.Right + 2,2,26,26)
$Form.Console.Style = 1
$Form.Console.FlatStyle = 1
$Form.Console.Pushed = 1
$Form.Console.Icon = $ImageList1.Images(3)
$Form.Console.OnClick = "fnOnShowHide()"
$Form.Console.ToolTipText = "Show/Hide Console Tree"
;endregion

;region === Status Bar ====================================================
$Form.StatusGroupBox = $Form.GroupBox()
$Form.StatusGroupBox.Height = 20
$Form.StatusGroupBox.Dock = 2
;endregion

;region === TreeView ======================================================
$Form.TreeView1 = $Form.TreeView()
$Form.TreeView1.Dock = 3
$Form.TreeView1.HideSelection = 0
$Form.TreeView1.ImageList = $ImageList1
$Form.TreeView1.OnAfterSelect = "fnOnAfterSelect()"
$Form.TreeView1.OnBeforeExpand = "fnOnBeforeExpand()"
$Form.TreeView1.Width = $Form.ClientWidth / 4
$Form.TreeView1.Tag = $Form.TreeView1.Width
;endregion

;region === Splitter ======================================================
$Form.Splitter1 = $Form.Splitter()
$Form.Splitter1.Dock = 3
;endregion

$Form.GroupBox1 = $Form.Controls.GroupBox()
$Form.GroupBox1.Dock = 5

;region === Listview Label ================================================
$Form.Label1 = $Form.GroupBox1.Label()
$Form.Label1.BorderStyle = 2
$Form.Label1.Dock = 1
$Form.Label1.Height = 20
$Form.Label1.TextAlign = 16
;endregion

;region === ListView ======================================================
$Form.ListView1 = $Form.GroupBox1.ListView()
$Form.ListView1.Dock = 5
$Form.ListView1.OnDoubleClick = "fnOnDoubleClick()"
$Form.ListView1.SmallImageList = $ImageList1

$ = $Form.ListView1.Columns.Add("Name",0.35*$Form.ListView1.ClientWidth)
$ = $Form.ListView1.Columns.Add("Class",0.25*$Form.ListView1.ClientWidth)
$ = $Form.ListView1.Columns.Add("Description",0.40*$Form.ListView1.ClientWidth)
;endregion

fnAddRootItems()
$Form.Show
;endregion

While $Form.Visible
$=Execute($Form.DoEvents)
Loop

Exit 1

;region === Functions =====================================================

Function fnAddRootItems()
Dim $objDomain,$objContainer,$rootDN,$node,$item,$child,$c
$objDomain = GetObject("LDAP://"+GetObject("LDAP://rootDSE").Get("defaultNamingContext"))
Global $lockoutThreshold $lockoutThreshold = $objDomain.lockoutThreshold
$rootDN = Join(Split(Join(Split($objDomain.distinguishedName,"DC="),""),","),".")
$node = $Form.TreeView1.Nodes.Add($rootDN,6,6)
$node.Tag = $objDomain.ADsPath
$Form.Text = $objDomain.ADsPath

For Each $objContainer in $objDomain
Select
Case $objContainer.Class = "organizationalUnit"
$child = $node.Nodes.Add(Split($objContainer.Name,"=")[1],15,15)
$Item = $Form.ListView1.Items.Add(Split($objContainer.Name,"=")[1],15)
Case 1
$child = $node.Nodes.Add(Split($objContainer.Name,"=")[1],5,5)
$Item = $Form.ListView1.Items.Add(Split($objContainer.Name,"=")[1],5)
EndSelect
$Item.SubItems(1).Text = $objContainer.Class
$Item.SubItems(2).Text = $objContainer.Description
$child.Tag = $objContainer.ADsPath
$c=$child.Nodes.Add("")
Next

$Form.TreeView1.SelectedNode = $node
$node.Expand()
EndFunction

Function fnCopy()
$Form.Clipboard1.Text = $Form.Text
$Form.Clipboard1.SelectionLength = Len($Form.Clipboard1.Text)
$Form.Clipboard1.Copy
EndFunction

Function fnLDAPQuery($What,Optional $From,$Filter,$OrderBy,$Scope,$User,$Pswd)

Dim $oCon,$oCMD,$oRS,$sQ,$aR,$C,$R

$sQ="<"+IIf($From="","LDAP://"+GetObject("LDAP://rootDSE").Get("defaultNamingContext"),
$From)+">;"+$Filter+";"+IIf(VarType($What)>8192,Join($What,','),$What)+";"+
IIf($Scope<>"base" And $Scope<>"onelevel","subtree",$Scope)

$oCon=CreateObject("ADODB.Connection")
$oCon.Provider="ADsDSOObject"
$oCon.Properties("Encrypt Password").Value=1
$oCon.Properties("ADSI Flag").Value=1
If $User And $Pswd
$oCon.Properties("User ID").Value=$User
$oCon.Properties("Password").Value=$Pswd
EndIf
$oCon.Open("Active Directory Provider")

$oCMD=CreateObject("ADODB.Command")
$oCMD.ActiveConnection=$oCon
$oCMD.CommandText=$sQ
$oCMD.Properties("Page Size").Value=1000
$oCMD.Properties("Timeout").Value=30
$oCMD.Properties("Cache Results").Value=0

If InStr($OrderBy,"distinguishedName")
$oRS=CreateObject("ADODB.Recordset")
$oRS.CursorLocation=3
$oRS.Sort=$OrderBy
$oRS.Open($sQ,$oCon,0,1,1)
Else
If $OrderBy
$oCMD.Properties("Sort On").Value=$OrderBy
EndIf
$oRS=$oCMD.Execute
EndIf
If @ERROR Exit @ERROR EndIf
If $oRS.BOF And $oRS.EOF Exit @ERROR EndIf

$aR = $oRS.GetRows()
Dim $aFR[Ubound($aR,2),Ubound($aR,1)]
For $R=0 to Ubound($aR,2)
For $C=0 to Ubound($aR,1)
$aFR[$R,$C]=$aR[$C,$R]
Next
Next

$fnLDAPQuery=$aFR
EndFunction

Function fnOnAfterSelect()
Dim $node,$sWhat,$aResults,$r,$item
$node = $Form.TreeView1.SelectedNode

$Form.Cursor = $System.CursorStyle.WaitCursor
$Form.Text = $node.Tag
$Form.ListView1.BeginUpdate()
$Form.ListView1.Items.Clear()

$sWhat = "Name","objectClass","description","userAccountControl","badPwdCount","ADsPath"
$aResults = fnLDAPQuery($sWhat,$node.Tag,,,"OneLevel")

For $r = 0 to Ubound($aResults)
If VarType($aResults[$r,1]) & 8192
Select
Case $aResults[$r,1][Ubound($aResults[$r,1])] = "user" And $aResults[$r,3] & 2
$Item = $Form.ListView1.Items.Add($aResults[$r,0],18)
Case $aResults[$r,1][Ubound($aResults[$r,1])] = "user" And $aResults[$r,4] = $lockoutThreshold
$Item = $Form.ListView1.Items.Add($aResults[$r,0],19)
Case $aResults[$r,1][Ubound($aResults[$r,1])] = "user"
$Item = $Form.ListView1.Items.Add($aResults[$r,0],17)
Case $aResults[$r,1][Ubound($aResults[$r,1])] = "computer" And $aResults[$r,3] & 2
$Item = $Form.ListView1.Items.Add($aResults[$r,0],1)
Case $aResults[$r,1][Ubound($aResults[$r,1])] = "computer"
$Item = $Form.ListView1.Items.Add($aResults[$r,0],0)
Case $aResults[$r,1][Ubound($aResults[$r,1])] = "group"
$Item = $Form.ListView1.Items.Add($aResults[$r,0],22)
Case $aResults[$r,1][Ubound($aResults[$r,1])] = "contact"
$Item = $Form.ListView1.Items.Add($aResults[$r,0],4)
Case $aResults[$r,1][Ubound($aResults[$r,1])] = "organizationalUnit"
$Item = $Form.ListView1.Items.Add($aResults[$r,0],15)
Case $aResults[$r,1][Ubound($aResults[$r,1])] = "domainPolicy"
$Item = $Form.ListView1.Items.Add($aResults[$r,0],7)
Case $aResults[$r,1][Ubound($aResults[$r,1])] = "nTFRSSettings"
$Item = $Form.ListView1.Items.Add($aResults[$r,0],14)
Case $aResults[$r,1][Ubound($aResults[$r,1])] = "rpcContainer"
$Item = $Form.ListView1.Items.Add($aResults[$r,0],16)
Case $aResults[$r,1][Ubound($aResults[$r,1])] = "foreignSecurityPrincipal"
$Item = $Form.ListView1.Items.Add($aResults[$r,0],13)
Case $aResults[$r,1][Ubound($aResults[$r,1])] = "volume"
$Item = $Form.ListView1.Items.Add($aResults[$r,0],24)
Case $aResults[$r,1][Ubound($aResults[$r,1])] = "trustedDomain"
$Item = $Form.ListView1.Items.Add($aResults[$r,0],6)
Case 1
$Item = $Form.ListView1.Items.Add($aResults[$r,0],5)
EndSelect
$Item.SubItems(0).Tag = $aResults[$r,5]
$Item.SubItems(1).Text = $aResults[$r,1][Ubound($aResults[$r,1])]
$Item.SubItems(2).Text = IIf(VarType($aResults[$r,2]) & 8192,Join($aResults[$r,2]),$aResults[$r,2])
EndIf
Next

$Form.Label1.Text = " " + $node.Text + " " + $Form.ListView1.Items.Count + " objects"

$Form.ListView1.Tag = $node
$Form.ListView1.EndUpdate()
$Form.Cursor = $System.CursorStyle.Default
EndFunction

Function fnOnBeforeExpand()
Dim $sWhat,$sFilter,$aResults,$r,$node,$child
If $Form.TreeView1.EventNode.Nodes.Count = 1 And $Form.TreeView1.EventNode.Nodes(0).Text = ""
$Form.Cursor = $System.CursorStyle.WaitCursor
$Form.TreeView1.EventNode.Nodes.Remove($Form.TreeView1.EventNode.Nodes(0))
$sWhat = "Name","ADsPath","objectClass"
$sFilter = "(|(objectCategory=organizationalUnit)(objectCategory=container))"
$aResults = fnLDAPQuery($sWhat,$Form.TreeView1.EventNode.Tag,$sFilter,,"OneLevel")
For $r = 0 to Ubound($aResults)
Select
Case AScan($aResults[$r,2],"organizationalUnit")=>0
$node = $Form.TreeView1.EventNode.Nodes.Add($aResults[$r,0],15,15)
$node.Tag = $aResults[$r,1]
$child = $node.Nodes.Add("")
Case AScan($aResults[$r,2],"container")=>0
$node = $Form.TreeView1.EventNode.Nodes.Add($aResults[$r,0],5,5)
$node.Tag = $aResults[$r,1]
$child = $node.Nodes.Add("")
EndSelect
Next
$Form.Cursor = $System.CursorStyle.Default
EndIf
$Form.TreeView1.EventNode.Expand()
EndFunction

Function fnOnDoubleclick()
Dim $item,$node,$i
$item = $Form.ListView1.SelectedItem
$node = $Form.TreeView1.SelectedNode
If $item.SubItems(1).Text = "organizationalUnit" Or $item.SubItems(1).Text = "container"
$node.Expand()
For $i = 0 to $node.Nodes.Count - 1
If $node.Nodes($i).Text = $item.Text
$Form.TreeView1.SelectedNode = $node.Nodes($i)
EndIf
Next
fnOnBeforeExpand()
Else
If $MessageBox1.Show($item.SubItems(0).Tag+@CRLF+@CRLF+"Copy to clipboard?") = 6
$Form.Clipboard1.Text = $item.SubItems(0).Tag
$Form.Clipboard1.SelectionLength = Len($Form.Clipboard1.Text)
$Form.Clipboard1.Copy
EndIf
EndIf
EndFunction

Function fnOnUp()
$Form.Cursor = $System.CursorStyle.WaitCursor
$Form.TreeView1.SelectedNode = $Form.TreeView1.SelectedNode.Parent
$Form.Cursor = $System.CursorStyle.DefaultCursor
EndFunction

Function fnOnShowHide()
If $Form.TreeView1.Visible
$Form.TreeView1.Hide
$Form.Splitter1.Hide
$Form.GroupBox1.Left = 0
$Form.GroupBox1.ClientWidth = $Form.ClientWidth
$Form.Refresh()
Else
$Form.TreeView1.Show
$Form.Splitter1.Show
$Form.GroupBox1.Dock = 5
$Form.Refresh()
EndIf
EndFunction

Function fnView()

$IconForm = $System.Form()
$IconForm.Icon = $ImageList1.Images(9)
$IconForm.FontName = "Tahoma"
$IconForm.Text = "Icons"

$IconLabel = $IconForm.Controls.Label()
$IconLabel.Dock = "Top"
$IconLabel.Image = $System.Bitmap.FromBase64String(fnBitmapStrip())

$IconForm.Size = 420,55

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3cP//Dd3Q/0T0RE/w3d2d3dAAAAAN
f7i4uLcN3dTX////iIj/cH////f//3AA3QAAAA/4Dd3dAAAAD/gN3d0AAAAP+A3d3dd3AAAP
+A0AAACPcN3d3dAAAAAACPcN3dd/eP//Dd1////////3cNf4AAAACHcN1/gAAAAIdw3Xd3AA
AAh3DdRERERERERNf////////4DXi4uLh3d3fX//93B4iIcAf//3cHiIhwDd3df4+PgN3d3d
1/+Pjw3d3X////8AAN3d3dd////w3dD/SP////Dd3Z3d3QAADd1/////9w3U1NeLi4uHd3d9
f3d/9///f33d0AAAAAAN3d3QAAAAAA3d3dAAAAAADd3d3dAAAAAADQAAAA/4Dd3d3QAAAAAA
/4Dd3dd////w3deIiIiIiIhw1///////dw3X//////93Ddf//////3cN1ERERERERE3Xd3d3
d3d3fd14uLh93d3deIiIcH//93B4iIhwf//3cN3d3X+Pj4Dd3d3df/j48N3df////4993d3d
3df///8A0P//////8N2ZmZ3d3d3d3Xi4uHd33URN3Xi4uH3d3d1///////933d3dAAAAAA3d
3d0AAAAADd3d3QAAAAAN3d3d3QAAAAAN0AAAAAAN3d3d0AAAAAAAAN3d3df///8A3Xd3d3d3
d33deIiIiIj3Dd14iIiIiPcN3XiIiIiI9w3d3d3d3d3d3d3d3d3d3d3d3dd3d93d3d3Xd3d9
eIiIcNd3d314iIhw3d3d13f4+A3d3d3Xd4+PDd1/////h93d3d3d3X//d93QAAAAAAAA3dmZ
3d3d3d3d14uH3d3d1N3d13d33d3d3Xd3d3d3d33d3d3QAAAA3d3d3dAAAADd3d3d0AAAAN3d
3d3d0AAAAN3dAAAAAA3d3d3d3dAAAAAA3d3d3X//d93d3d3d3d3d3d3Xd3d3d3fd3dd3d3d3
d93d13d3d3d33d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3Xd3d93d3d3dd3d33d3d3d
3Xd3fd3d3d3dd3d93Xd3d3d93d3d3d3d13fd3d3d3d3d3d3d3Z3d3d3d3d3dd33d3d3d3d3d
3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3QAAAA3d3d
3d3d3QAAAA3d3d3d13fd3d3d3d3d3d3d
"
EndFunction
;endregion



Edited by benny69 (2006-02-21 06:44 PM)
_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)

Top
#157504 - 2006-02-21 10:41 PM Re: AD Explorer by Chris S.
kirkside Offline
Getting the hang of it

Registered: 2006-01-19
Posts: 52
Loc: UK
I appreciate the reply. Strange, but the script would not work for me. Did not even load.
Top
#157505 - 2006-02-21 10:48 PM Re: AD Explorer by Chris S.
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
It requires the latest version of KiXforms (not the .net version) to handle the base64 bitmap imbedded in the script.
Top
#157506 - 2006-02-21 11:26 PM Re: AD Explorer by Chris S.
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
here is a link to the needed ver of KiXforms
_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)

Top
#157507 - 2006-02-22 11:11 AM Re: AD Explorer by Chris S.
kirkside Offline
Getting the hang of it

Registered: 2006-01-19
Posts: 52
Loc: UK
The code was originally as below. There is no reference to the computer object.accountdisabled. I have now added Case $object.Class = "computer" And $object.AccountDisabled $Icon = $cx (with the icon grabbed from AD) and it now works. Thanks for your help guys.

Ps. Still could not get the script to work and I am using the latest version of Kixforms. Thanks anyway.

Code:
 
Select
Case $object.Class = "organizationalUnit" $Icon = $o
Case $object.Class = "user" And $object.AccountDisabled $Icon = $ux
Case $object.Class = "user" And $object.IsAccountLocked $Icon = $ul
Case $object.Class = "user" $Icon = $u
Case $object.Class = "group" $Icon = $g
Case $object.Class = "computer" $Icon = $c
Case 1 $Icon = 45
EndSelect


Top
#157508 - 2006-02-28 03:33 PM Re: AD Explorer by Chris S.
kirkside Offline
Getting the hang of it

Registered: 2006-01-19
Posts: 52
Loc: UK
Is there a way to use a combo box instead of the tabs? Would be a quicker of choosing the site than the tabs. I have tried to work it out, but due to me still learning I am having no luck. Cheers.
Top
#157509 - 2006-02-28 06:24 PM Re: AD Explorer by Chris S.
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
It would be quicker to use the new AD Explorer that uses a TreeView.
Top
#157510 - 2006-02-28 07:46 PM Re: AD Explorer by Chris S.
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11629
Loc: CA
KiXforms - Active Directory Browser Version 2 (with TreeView)
http://www.kixtart.org/ubbthreads/showflat.php?Cat=0&Number=144246

Top
#157511 - 2006-02-28 09:26 PM Re: AD Explorer by Chris S.
kirkside Offline
Getting the hang of it

Registered: 2006-01-19
Posts: 52
Loc: UK
Thanks guys. Strange, but it will not work on my computer. No errors, just nothing. I am using version 4.52.0.0 of KIX32.exe and version 2.46.36.0 of kixforms.dll. Any ideas?
Top
#157512 - 2006-02-28 09:37 PM Re: AD Explorer by Chris S.
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
place this:
Code:

If Not $System
$= MessageBox("KiXforms Not Initiated. This Script Will Now Close.","Error",16)
Quit()
EndIf


on the line just after:
Code:

$System = CreateObject("Kixtart.System")


this will tell you if the problem is related KiXforms.
_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)

Top
#157513 - 2006-02-28 10:13 PM Re: AD Explorer by Chris S.
kirkside Offline
Getting the hang of it

Registered: 2006-01-19
Posts: 52
Loc: UK
Thanks Benny. No error message appears.
Top
#157514 - 2006-03-01 12:15 AM Re: AD Explorer by Chris S.
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
The script is probably crashing - check out your app event log for any crash messages ... the probable reason is in the way the script gets copy-pasted - sometimes the "embedded icon" strings can get messed up and the graphics routines can be a little fussy ...

First step - let us know if indeed the script is crashing.

Top
#157515 - 2006-03-01 10:19 AM Re: AD Explorer by Chris S.
kirkside Offline
Getting the hang of it

Registered: 2006-01-19
Posts: 52
Loc: UK
Thanks Shawn,

I get this error message as soon as I execute the script:

The description for Event ID ( 5 ) in Source ( KIXTART ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: Fatal exception occurred.
Error : (0xc0000005/-1073741819).

Top
#157516 - 2006-03-01 10:51 AM Re: AD Explorer by Chris S.
kirkside Offline
Getting the hang of it

Registered: 2006-01-19
Posts: 52
Loc: UK
I found the problem, it is the below line:

Code:

$ImageList1.AddStrip($System.Bitmap.FromBase64String(fnBitmapStrip()))



If I remove the line, the browser opens fine, but without it, there are no icons like computers and disabled accounts available.

Any ideas how to solve this one?

Top
#157517 - 2006-03-01 01:33 PM Re: AD Explorer by Chris S.
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Hmm ... try that with the latest kixforms development build registered :


link to latest kixforms development build

Make sure that you first de-register the old version as there were changes in the namespace:

regsrv32 /u [path]kixforms.dll


Edited by Jochen (2006-03-01 01:37 PM)
_________________________



Top
#157518 - 2006-03-01 02:12 PM Re: AD Explorer by Chris S.
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
yup, plus text edit your way to this function here:

fnBitmapStrip()

it prolly looks something like this:

Code:

Function fnBitmapStrip()
$fnBitmapStrip = "
XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
"
EndFunction



What you should do is pay special attention to how the double-quotes are laid-out, to be safe, arrange them to look like this:

Code:

Function fnBitmapStrip()
$fnBitmapStrip = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
EndFunction



The other thing that can happen is that all the lines get "scrunched" together, and they are longer (much longer) than say 80 bytes each. In your text editor, they will extend past the right hand window. If this has happened, try re-pasting it from where-ever you got the code from.

And advise after trying what Jochen and I recommend.

Top
#157519 - 2006-03-01 02:22 PM Re: AD Explorer by Chris S.
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
hmm...
afaik, I did some testing with kf base64 implementation and it's quite loose with the line up.
that is, it does not care about the line lengths being correct or about extra linefeeds.
_________________________
!

download KiXnet

Top
Page 1 of 2 12>


Moderator:  Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2419 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.051 seconds in which 0.019 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org