Jump to content

Grasty

Members
  • Posts

    16
  • Joined

  • Last visited

Grasty's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. I think i figured it out. We were putting the below at the top of all of our internally made UDFs. #EndRegion #EndRegion #include-once And there was a few cases where i was including a UDF that had already been included, so it was adding 2 lines to the stripped version each additional time i included the file. If i change it to the following then it resolves the issue and everything lines up again #include-once #EndRegion #EndRegion So dumb mistake on my part.
  2. Unfortunately I cant share the script, But ill see if i can reproduce it with something else. Also i ran it in Scite and it was off by 14. It was 11165 in the stripped file not 11179
  3. So first things first, yes I know you can use AU3Stripper with /MergeOnly to get the line numbers to match error messages. However, the error I am getting is telling me "Error: Array variable has incorrect number of subscripts or subscript dimension range is exceeded." on Line 11179, so i did a MergeOnly but line 11179 is an EndIf. So I am wondering if there is anything that throws that line number off? I read that #pragma stuff would, but i dont have any of those. Unless the AutoIt3Wrapper compiler directives count also? But if i remove those then 11179 is a Sleep(100) .... so im a little lost.
  4. Is there something I have to do to get this to work? Cause it doesnt seem to be providing Intellisense/Code Hints for the functions I have in UDF/includes.
  5. Got sidetracked with other stuff and just circling back to this. Querying the city or state field provides the same error as if you attempt to query a field that doesnt exist and givenname, ou, title are in a normal string format from what i can tell, and city/state are in some kind of binary format like Byte Array or BLOB. There is a powershell screenshot in the original post that shows the city/state/title for examples. For example, if you look at the state field it lists {73 76}, and in powershell if you do [char]73 + [char]76 then it will give you the proper state (IL). But for whatever reason the LDAP Query will not grab that data since it is in that weird binary/byte array/blob format And the code in Post 2 was an attempt to query LDAP using a different method to show that it doesnt work using that simplified method either. That is completely different code than what is in Post 1 and Post 5
  6. in the OP it crashes at Line 215 and now 218 ... Its still the same line though ( $oRecordSet = $oComm.Execute() ). The only difference is when i was trying stuff and removed what i tried i left some extra blank lines in so it shifted that line down 3 lines. The file that im using has a bunch of other functions that arent related to the issue im having (and are never called) so i only pasted the relevant code ... so maybe its line 38 in the code i pasted, but its 215 (and now 218) in the file im working with. Either way the code im using hasnt changed except for a couple extra blank lines that shifted some code downwards.
  7. I was using an Error Handler, but i replaced it with the one in the help file and i still get the same error err.number is: 0x80020009 err.windescription: Exception occurred. err.description is: Unspecified error err.source is: Provider err.helpfile is: err.helpcontext is: 1240640 err.lastdllerror is: 0 err.scriptline is: 218 err.retcode is: 0x80004005
  8. any ideas? Still havent managed to get this to work.
  9. Also if it helps, I get a similar issue if i do OpenLDAP instead of using the ADO Connection $LDAP = ObjGet("LDAP://ldap.test.com/cn=test_user,DC=test,DC=com") MsgBox(0,"",$LDAP.city) "D:\Repo\projects\ldap.au3" (38) : ==> Variable must be of type "Object".: MsgBox(0,"",$LDAP.city) MsgBox(0,"",$LDAP^ ERROR
  10. Im having some trouble trying to get an LDAP Query (Non Active Directory) to pull some information Specifically, I can get the Query to pull some fields like givenname, ou, title. But not other fields like city and State. After playing with it for a while, I tried pulling the data in Powershell and noticed that some fields are stored as text and others are stored as byte arrays It seems that I can successfully query any of the fields with text in them, and none of the fields with byte arrays work. If I try and pull the byte array fields I end up with a COM Error Running LDAP Query.... @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@ COM Error Intercepted! @@ err.description is : Unspecified error @@ err.windescription : Exception occurred. @@ err.number is : 80020009 @@ err.lastdllerror : 0 @@ err.scriptline : 215 @@ err.source is : Provider @@ err.helpfile : @@ err.helpcontext : 1240640 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ And here is my code - Line 215 is $oRecordSet = $oComm.Execute() $Location = _Ldap_Search("test.user","city","cn") MsgBox(0,"",$Location) Func __Ldap_SetQueryString($sSearchVal,$sReturnFields,$sSearchField,$sLdapServer) ;Construct LDAP Query String using passed parameters $g_sLdap_QueryString = StringFormat("SELECT %s FROM 'LDAP://%s' WHERE %s = '%s'", $sReturnFields,$sLdapServer,$sSearchField,$sSearchVal) ;Return "SELECT " & $sReturnFields & " FROM 'LDAP://" & $sLdapServer & "' WHERE " & $sSearchField & " = '" & $sSearchVal & "'" Return $g_sLdap_QueryString EndFunc Func _Ldap_Search($sSearchVal,$sReturnFields=Default,$sSearchField=Default,$sLdapServer=Default) Local Const $DEFAULT_RETURN_FIELDS = "givenName,sn,mail,title,ou" Local Const $DEFAULT_SEARCH_FIELD = "uid" Local Const $DEFAULT_LDAP_SERVER = "ldap.server.com:389" ;Set Defaults If $sReturnFields = Default Then $sReturnFields = $DEFAULT_RETURN_FIELDS if $sSearchField = Default Then $sSearchField = $DEFAULT_SEARCH_FIELD if $sLdapServer = Default Then $sLdapServer = $DEFAULT_LDAP_SERVER $g_sLdap_ErrorMessage = "" ;Intialize Locals Local $oConnection = ObjCreate("ADODB.Connection") Local $oRecordSet = ObjCreate("ADODB.RecordSet") Local $oComm = ObjCreate("ADODB.Command") Local $oRecordSet = Null Local $sQuery = "", $sUser = "" Local $asUsers = Null ;Will Contain array of Search Criteris (1 or more items) Local $iCount = 0 Local $asProperties = StringSplit($sReturnFields,",",$STR_NOCOUNT) ;Property Names that will be Returned from LDAP Local $asSearchVals = StringSplit($sSearchVal,",",$STR_NOCOUNT) ;Value(s) that will be used as LDAP Search Criteria Local $asReturnVal[0][0] ;2D array returned by func (will redim to match caller spec later) ReDim $asReturnVal[UBound($asSearchVals)+1][UBound($asProperties)+1] ;Assign search criteria attribute name to element[0][0] $asReturnVal[0][0] = $sSearchField ;Assign search result attribut names to elements [0][1..n] For $i = 1 to UBound($asSearchVals) $asReturnVal[$i][0] = $asSearchVals[$i-1] Next For $j = 1 to UBound($asProperties) $asReturnVal[0][$j] = $asProperties[$j-1] Next ;Setup ADODB objects for LDAP query $oConnection.Provider = "ADsDSOObject" $oConnection.Open("ADs Provider") ;__Ldap_ConsoleWriteLine("Isobj : " & IsObj($oConnection)) $oComm.ActiveConnection = $oConnection ;Prep array for multiple queries $asUsers=StringSplit($sSearchVal,",",$STR_NOCOUNT) ;Query LDAP with each Search Value For $sUser In $asUsers $iCount = $iCount + 1 $sQuery = __Ldap_SetQueryString($sUser,$sReturnFields,$sSearchField,$sLdapServer) $oComm.CommandText = $sQuery $oComm.Properties.Item("Page Size") = 50 $oComm.Properties.Item("Timeout") = 30 $oRecordSet = $oComm.Execute() if @error Then $g_sLdap_ErrorMessage = "Ldap ERROR: " & "Make sure you are connected to the corporate nextwork." Else While Not $oRecordSet.EOF ;Assign Property Values to 2-D Array For $j = 1 to UBound($asReturnVal,2)-1 $asReturnVal[$iCount][$j] = $oRecordSet.Fields.Item($asReturnVal[0][$j]).Value[0] Next $oRecordSet.MoveNext WEnd EndIf Next __Ldap_SetSearchResult_FmtArray($asReturnVal) __Ldap_SetSearchResult_FmtList($asReturnVal) $g_asLdap_SearchResult = $asReturnVal Return($asReturnVal) EndFunc
  11. Ok, so i figured out how to make it work ... i just had to make my icon smaller in height so it doesnt take up the entire button and then the text just naturally moves into place. My new question though, is there a way to adjust the padding for the text? The hard drive image there is all the way up against the bottom edge of that icon and the text is taking up a lot of space vertically. If i cant do it, then i cant do it .... but it would be really nice if i could adjust that vertical padding.
  12. So I have a button that is 80x80 which I have assigned an icon image to, and that works .... But i also want to use the style to put the button text at the bottom of the button, and i cant seem to make this work $Button = GUICtrlCreateButton("Test",100,100,80,80,$BS_ICON) GUICtrlSetImage($Button,"C:\icon.ico") The above works for the Icon portion, and the background on the icon is transparent so you can still see the button effects like the hover and such, but if i try and add $BS_BOTTOM as well it doesnt work. So i did some google searching and found a post about using BitOR, so i modified it to the following $Button = GUICtrlCreateButton("Test",100,100,80,80,BitOR($BS_ICON,$BS_BOTTOM)) GUICtrlSetImage($Button,"C:\icon.ico") But that doesnt seem to work. Am i doing something wrong? or is there another way to do this. Its shifting the image up and the text isnt showing at all.
  13. Ok, nevermind, it isnt InetGet that is the problem .... I made a simple InetGet Test and it worked fine on both systems #include <InetConstants.au3> $RemotePath = "http://internal.website/folder/mudt.exe" $DownloadPath = @UserProfileDir & "\MUDT\mudt.exe" InetGet($RemotePath,$DownloadPath) The problem is that i am getting that RemotePath from an Ini and my VM cant get the remotepath from that Ini for some reason. Thanks for the help though.
  14. It downloads the file fine when i put the URL in the browser
  15. Would appreciate some help with this. I have no idea why this is failing.
×
×
  • Create New...