AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

COM Standard Library
Goto page Previous  1, 2, 3 ... 39, 40, 41, 42, 43, 44  Next
 
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
Sean



Joined: 12 Feb 2007
Posts: 2462

PostPosted: Tue Jun 01, 2010 4:12 pm    Post subject: Reply with quote

Use AHK_L/COM_L.
http://www.autohotkey.com/forum/topic22923-429.html
Back to top
View user's profile Send private message
ApertureLabs
Guest





PostPosted: Tue Jun 01, 2010 4:21 pm    Post subject: Reply with quote

Sean wrote:
Use AHK_L/COM_L.
http://www.autohotkey.com/forum/topic22923-429.html


So, what I've been using is outdated? Embarassed
Back to top
Guest






PostPosted: Tue Jun 01, 2010 4:46 pm    Post subject: Reply with quote

COM is now built into AHK:
http://www.autohotkey.com/forum/topic58237.html

However, this native COM doesn't support named parameters, but, it allows up to 50 parameters, which is practically no limit.
Back to top
hughman



Joined: 11 Feb 2007
Posts: 166

PostPosted: Tue Jun 08, 2010 11:49 am    Post subject: Reply with quote

COM_CreateObject always return null in COM_L.
Plz check it.
Back to top
View user's profile Send private message
tank



Joined: 21 Dec 2007
Posts: 3700
Location: Louisville KY USA

PostPosted: Tue Jun 08, 2010 12:04 pm    Post subject: Reply with quote

there are 2 versions of COM one for the vanilla ahk and one for ahk_l. Please ensure you have the right version with the right version. the only way create object returns 0 or blank is if your ProgID is invalid or not properly registered.
_________________

We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
Back to top
View user's profile Send private message
sinkfaze



Joined: 18 Mar 2008
Posts: 5044
Location: the tunnel(?=light)

PostPosted: Tue Jun 08, 2010 12:46 pm    Post subject: Reply with quote

hughman wrote:
COM_CreateObject always return null in COM_L.
Plz check it.


Did you check the variable with IsObject() to verify that no object has been retrieved? A variable which houses an object will return null if you check it like a normal variable.
_________________
Try Quick Search for Autohotkey or see the tutorial for newbies.
Back to top
View user's profile Send private message Send e-mail
hughman



Joined: 11 Feb 2007
Posts: 166

PostPosted: Tue Jun 08, 2010 2:20 pm    Post subject: Reply with quote

sinkfaze wrote:


Did you check the variable with IsObject() to verify that no object has been retrieved? A variable which houses an object will return null if you check it like a normal variable.


So COM_CreateObject("ADODB.Connection") will return an object in COM for AHK_L other than a handle as in COM for mainstream AHK?
Back to top
View user's profile Send private message
sinkfaze



Joined: 18 Mar 2008
Posts: 5044
Location: the tunnel(?=light)

PostPosted: Tue Jun 08, 2010 5:27 pm    Post subject: Reply with quote

Correct, if you want to check if the variable COM_CreateObject("ADODB.Connection") was saved to represents an object use the IsObject() function.
_________________
Try Quick Search for Autohotkey or see the tutorial for newbies.
Back to top
View user's profile Send private message Send e-mail
jethrow



Joined: 24 May 2009
Posts: 1907
Location: Iowa, USA

PostPosted: Tue Jun 08, 2010 5:38 pm    Post subject: Reply with quote

For AHKL & COM_L:
Code:
if ptr := COM_CreateObject("ADODB.Connection") ; doesn't return null
   MsgBox, % COM_Unwrap( ptr ) ; shows pointer address/handle
      . "`n" IsObject( ptr ) ; shows 1

_________________
Very Happy - in case I forgot to smile
Basic Webpage Controls
COM Object Reference
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
ddk`notlogdin
Guest





PostPosted: Tue Jun 15, 2010 9:51 am    Post subject: Reply with quote

Hi, I've been wondering for a long time for using this library, but I havent found any documentation about the commands Confused Could someone please help me started?
Back to top
IsNull



Joined: 10 May 2007
Posts: 593
Location: .switzerland

PostPosted: Tue Jun 15, 2010 10:38 am    Post subject: Reply with quote

COM is not a Library in the normal sense - COM is an interface to make Programms/Librarys compatible to other Languages.

http://en.wikipedia.org/wiki/Component_Object_Model
_________________
http://securityvision.ch
AHK 2D GAME ENGINE
Back to top
View user's profile Send private message Visit poster's website
ddk`notlogdin
Guest





PostPosted: Tue Jun 15, 2010 10:54 am    Post subject: Reply with quote

IsNull wrote:
COM is not a Library in the normal sense - COM is an interface to make Programms/Librarys compatible to other Languages.

http://en.wikipedia.org/wiki/Component_Object_Model


So, what is it capable to improve in AHK? How could I benefit with COM?
Back to top
IsNull



Joined: 10 May 2007
Posts: 593
Location: .switzerland

PostPosted: Tue Jun 15, 2010 11:26 am    Post subject: Reply with quote

You can easily control Programs which are COM compatible. For Example Outlook - you can use COM to let Outlook do anything you want.

All the Office Programs have COM included and many others too.
_________________
http://securityvision.ch
AHK 2D GAME ENGINE
Back to top
View user's profile Send private message Visit poster's website
ddk`notlogdin
Guest





PostPosted: Tue Jun 15, 2010 12:02 pm    Post subject: Reply with quote

I see. I've been reading the tutorial about the basic webpage controls with COM and with searching I've also found iWebBrowser2 Learner. The iWebBrowser2 Learner seems to be pretty, I was impressed how detailed information I got about the values and the controls (name, id & stuff..).
If I've understood right, I could make highly automated softwares for webapplications, like client-based facebook ( Very Happy ) or maybe a bot for browserbased game, could I?

Well, maybe some practising first. May I request a sample script which could messagebox current IE windows current controls details via hotkey. Just like the iWebBrowser2 Learner does, but into GUI. I guess I could make it myself, reading from iWebBrowser2 Learner's source, but it's pretty hard to understand (as far as I've read it..).

Please, don't understand me wrong. I hope I dont bother you guys, too much and I post to right thread. Smile
Back to top
ddk



Joined: 28 Dec 2009
Posts: 43

PostPosted: Wed Jun 16, 2010 12:12 pm    Post subject: Reply with quote

ddk`notlogdin wrote:
I see. I've been reading the tutorial about the basic webpage controls with COM and with searching I've also found iWebBrowser2 Learner. The iWebBrowser2 Learner seems to be pretty, I was impressed how detailed information I got about the values and the controls (name, id & stuff..).
If I've understood right, I could make highly automated softwares for webapplications, like client-based facebook ( Very Happy ) or maybe a bot for browserbased game, could I?

Well, maybe some practising first. May I request a sample script which could messagebox current IE windows current controls details via hotkey. Just like the iWebBrowser2 Learner does, but into GUI. I guess I could make it myself, reading from iWebBrowser2 Learner's source, but it's pretty hard to understand (as far as I've read it..).

Please, don't understand me wrong. I hope I dont bother you guys, too much and I post to right thread. Smile


Hey,
I think, I just did it.. somehow Very Happy, just need help to get the very current controls value. Eh, my code:
Code:
r::
COM_CoInitialize()
pweb := GetWebBrowser()
MsgBox % COM_Invoke(pweb, "document.getElementsByTagName[input].item[3].value")
COM_Release(pweb)
COM_CoUninitialize()
Return

I know it's like 666% of copypaste, but however, just testing Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2, 3 ... 39, 40, 41, 42, 43, 44  Next
Page 40 of 44

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group