So, how I can get the active controls value in IE? :?
COM Standard Library
Started by
Sean
, Sep 08 2007 01:10 AM
669 replies to this topic
#601
-
Posted 18 June 2010 - 12:21 AM
what presicely is an active controls value ???? i seem to iliterate to understand
:shock:
:shock:
#602
-
Posted 18 June 2010 - 02:56 AM
Never lose.
WIN or LEARN.
WIN or LEARN.
Apologies for being rough.what presicely is an active controls value ???? i seem to iliterate to understand
:shock:
Well.. Explanatory picture:
I just want my script get the value like iWebBrowser2 Learner does.
#603
-
Posted 18 June 2010 - 12:57 PM
There are several tutorials in the forum covering this, not to mention one outdated tutorial by tank covering almost this exact example. Start here.
#604
-
Posted 18 June 2010 - 02:28 PM
Ive been reading that tutorial (as you can see from last page), but couldn't find it. I'll read that once again and keep looking.There are several tutorials in the forum covering this, not to mention one outdated tutorial by tank covering almost this exact example. Start here.
#605
-
Posted 18 June 2010 - 03:39 PM
Not sure who's dealt with ADO using the latest AutoHotKey_COM but I seem to be running into an issue.
This Function Works fine before compiling but afterward I get an error that says the variable rs.EOF contains an illegal character.
Maybe I missed something but I'm not sure since, like I said, it works when it's not compiled. (It compiles with no errors either)
Here is the code to generate a connection:
There are other functions as well that are all part of a wrapper class as I have numerous programs that access my database.
This Function Works fine before compiling but afterward I get an error that says the variable rs.EOF contains an illegal character.
Maybe I missed something but I'm not sure since, like I said, it works when it's not compiled. (It compiles with no errors either)
MySQL_Query_RS(connection, query) { ;If it is not a SELECT statement, assume there is no need for an RS as it is a modifier if (SubStr(query, 1, 6) != "SELECT") return connection.Execute(query) rs := ComObjCreate("ADODB.RecordSet") rs.Open(query, connection) If (rs.EOF) Msgbox, No Data returned by this query`n`n%query% return rs }
Here is the code to generate a connection:
CreateMySQLConnection(username, password, databaseName, hostIP) { local dsn dsn := "DRIVER={MySQL ODBC 3.51 Driver};SERVER=" . hostIP . ";DATABASE=" . databaseName . ";USER=" . username . ";PASSWORD=" . password . ";OPTION=3;" connection := ComObjCreate("ADODB.Connection") connection.Open(dsn) return connection }
There are other functions as well that are all part of a wrapper class as I have numerous programs that access my database.
#606
-
Posted 25 June 2010 - 05:09 PM
@ribbs2521: Make sure you're using my custom AutoHotkey build (AHK_COM was merged into it) instead of the regular AutoHotkey.exe.
The file you want is AutoHotkey_La.exe (which is the 32-bit ANSI version).
The file you want is AutoHotkey_La.exe (which is the 32-bit ANSI version).
#607
-
Posted 25 June 2010 - 05:13 PM
Fincs, I wasn't using that file but even after doing so I get the same thing.
Edit: Scratch that, I compiled it with Compile_AHK using Compile with options. When I just used Compile from the context menu it works fine. Any idea why that is? I would like to be able to compile with options. Sorry, when it comes to compiling and all of that stuff I have no idea what's going on. At least with writing applications I am somewhat capable.
Edit: Scratch that, I compiled it with Compile_AHK using Compile with options. When I just used Compile from the context menu it works fine. Any idea why that is? I would like to be able to compile with options. Sorry, when it comes to compiling and all of that stuff I have no idea what's going on. At least with writing applications I am somewhat capable.
#608
-
Posted 25 June 2010 - 05:26 PM
I'm using ahk_l and the latest com version, both ansi.
Using the following function in a folder with ~40 files I get about 2-3 COM errors saying this:
The function expects Select to be an array object from Temp01's array library: <!-- m -->http://www.autohotke...topic49736.html<!-- m -->
The values may contain * as placeholders, so you can use *.jpg etc.
Any idea why I'm seeing those errors? I've also noticed them at some other functions involving COM, but they're only happening sometimes and haven't disturbed me yet since I could just turn them off and they wouldn't disturb functionality much. I would like to get rid of them here though, since this function will not select all files in its current state.
Using the following function in a folder with ~40 files I get about 2-3 COM errors saying this:
Function Name: "Name"
ERROR: No COM Dispatch Object!
SelectFiles(Select,Clear=1,Deselect=0,MakeVisible=1,focus=1, hWnd=0) { If hWnd||(hWnd:=WinActive("ahk_class CabinetWClass"))||(hWnd:=WinActive("ahk_class ExploreWClass")) { sa := Com_CreateObject("Shell.Application") ;Find hwnd window wins := sa.Windows loop % wins.count { window:=wins.Item(A_Index-1) If Not InStr( window.FullName, "steam.exe" ) ; ensure pwb isn't IE if(window.Hwnd=hWnd) break } doc:=window.Document value:=!Deselect value1:=!Deselect+focus*16+MakeVisible*8 if(Clear) value1+=clear*4 Loop % Select.len() { filter := Select[A_Index] If filter <> { If(InStr(filter, "*")) { filter := "\Q" StringReplace(filter, "*", "\E.*\Q", 1) "\E" filter := strTrim(filter,"\Q\E") Loop % doc.Folder.Items.Count { item := doc.Folder.Items.Item(A_Index) if(RegexMatch(item.Name,"i)" filter)) { COM_Invoke(doc,"SelectItem",item,index=1 ? value1 : value) ;http://msdn.microsoft.com/en-us/library/bb774047(VS.85).aspx index++ } } } else COM_Invoke(doc,"SelectItem",doc.Folder.ParseName(filter),(A_Index=1 ? value1 : value)) ;http://msdn.microsoft.com/en-us/library/bb774047(VS.85).aspx } } } }
The function expects Select to be an array object from Temp01's array library: <!-- m -->http://www.autohotke...topic49736.html<!-- m -->
The values may contain * as placeholders, so you can use *.jpg etc.
Any idea why I'm seeing those errors? I've also noticed them at some other functions involving COM, but they're only happening sometimes and haven't disturbed me yet since I could just turn them off and they wouldn't disturb functionality much. I would like to get rid of them here though, since this function will not select all files in its current state.
#609
-
Posted 22 July 2010 - 02:29 PM
I'm not sure why you posted in this thread. Have you pinned down the origin of your errors? Is it a bug in COM.ahk, or a bug in Windows' shell etc, or a bug in your code or just your system? I failed to see any COM.ahk related errors in this but I could spot an error in your code. So, what are you expecting from me by only saying you got errors with your code?
#610
-
Posted 22 July 2010 - 11:52 PM
Can someone show example to call function from the following OCX.
<!-- m -->http://www.freedownl... ... Crypt.html<!-- m -->
<!-- m -->http://www.freedownl... ... Crypt.html<!-- m -->
#611
-
Posted 23 July 2010 - 01:39 PM
Sean, you are right, I did not realize that I needed to use zero based index for the folderitems, but this is not the cause of this error.
I noticed that if I add a sleep 10 after each SelectItem call, it works fine, so I can only suspect that there is an issue in COM or explorer shell. My knowledge of COM is not good enough to figure anything out on that level, which is why I'm asking here.
Do I need to release any resources? I was thinking that COM_Release was not needed anymore?
I noticed that if I add a sleep 10 after each SelectItem call, it works fine, so I can only suspect that there is an issue in COM or explorer shell. My knowledge of COM is not good enough to figure anything out on that level, which is why I'm asking here.
Do I need to release any resources? I was thinking that COM_Release was not needed anymore?
#612
-
Posted 23 July 2010 - 05:28 PM
You better consult the documentation of the app. Not many users may like to install a foreign app.Can someone show example to call function from the following OCX.
#613
-
Posted 24 July 2010 - 02:08 AM
This is understandable. Some shell operations don't wait until all needed underlying procedures are completed, probably/mainly for performance reason. It's similar to Navigate(2) in IWebBrowser2. The simplest solution to this may be to add sufficient sleep as you did. Or you could utilize the event SelectionChanged in DShellFolderVeiwEvents. Or you may call directly the function SelectItem in the interface IFolderView.I noticed that if I add a sleep 10 after each SelectItem call,
It's no longer needed with COM_L/AHK_L. BTW, I strongly recommend UNICODE build over ANSI build.Do I need to release any resources? I was thinking that COM_Release was not needed anymore?
#614
-
Posted 24 July 2010 - 02:22 AM
Hmm, I'll have to try finding a good sleep ammount, sleeping after every call makes it quite slow, maybe with the method mentioned in docs for shorter sleep.
I'm planning to switch to Unicode at some point, but I'm not sure if I'm going to do it before IronAHK is ready.
Just for information, it appears that the calls to doc.Folder.Items.Item or to item.Name are causing the problems. I've separated the loop that queries the name and the loop for file selection, and SelectItem works fine without sleeps.
I'm planning to switch to Unicode at some point, but I'm not sure if I'm going to do it before IronAHK is ready.
Just for information, it appears that the calls to doc.Folder.Items.Item or to item.Name are causing the problems. I've separated the loop that queries the name and the loop for file selection, and SelectItem works fine without sleeps.
#615
-
Posted 24 July 2010 - 08:58 AM