Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

COM Standard Library


  • Please log in to reply
669 replies to this topic
Sean
  • Members
  • 2462 posts
  • Last active: Feb 07 2012 04:00 AM
  • Joined: 12 Feb 2007
Use AHK_L/COM_L.
<!-- m -->http://www.autohotke...c22923-429.html<!-- m -->

ApertureLabs
  • Guests
  • Last active:
  • Joined: --

Use AHK_L/COM_L.
http://www.autohotke...c22923-429.html


So, what I've been using is outdated? :oops:

  • Guests
  • Last active:
  • Joined: --
COM is now built into AHK:
<!-- m -->http://www.autohotke...topic58237.html<!-- m -->

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

hughman
  • Members
  • 192 posts
  • Last active: Feb 14 2016 06:59 AM
  • Joined: 11 Feb 2007
COM_CreateObject always return null in COM_L.
Plz check it.

tank
  • Administrators
  • 4345 posts
  • AutoHotkey Foundation
  • Last active: May 02 2019 09:16 PM
  • Joined: 21 Dec 2007
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.
Never lose.
WIN or LEARN.

sinkfaze
  • Moderators
  • 6367 posts
  • Last active: Nov 30 2018 08:50 PM
  • Joined: 18 Mar 2008

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.

hughman
  • Members
  • 192 posts
  • Last active: Feb 14 2016 06:59 AM
  • Joined: 11 Feb 2007

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?

sinkfaze
  • Moderators
  • 6367 posts
  • Last active: Nov 30 2018 08:50 PM
  • Joined: 18 Mar 2008
Correct, if you want to check if the variable COM_CreateObject("ADODB.Connection") was saved to represents an object use the IsObject() function.

jethrow
  • Moderators
  • 2854 posts
  • Last active: May 17 2017 01:57 AM
  • Joined: 24 May 2009
For AHKL & COM_L:
if ptr := COM_CreateObject("ADODB.Connection") ; doesn't return null

	MsgBox, % COM_Unwrap( ptr ) ; shows pointer address/handle

		. "`n" IsObject( ptr ) ; shows 1


ddk`notlogdin
  • Guests
  • Last active:
  • Joined: --
Hi, I've been wondering for a long time for using this library, but I havent found any documentation about the commands :? Could someone please help me started?

IsNull
  • Moderators
  • 990 posts
  • Last active: May 15 2014 11:56 AM
  • Joined: 10 May 2007
COM is not a Library in the normal sense - COM is an interface to make Programms/Librarys compatible to other Languages.

<!-- m -->http://en.wikipedia....nt_Object_Model<!-- m -->

ddk`notlogdin
  • Guests
  • Last active:
  • Joined: --

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

http://en.wikipedia....nt_Object_Model


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

IsNull
  • Moderators
  • 990 posts
  • Last active: May 15 2014 11:56 AM
  • Joined: 10 May 2007
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.

ddk`notlogdin
  • Guests
  • Last active:
  • Joined: --
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 ( :D ) 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. :)

ddk
  • Members
  • 43 posts
  • Last active: Oct 12 2010 11:03 PM
  • Joined: 28 Dec 2009

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 ( :D ) 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. :)


Hey,
I think, I just did it.. somehow :D, just need help to get the very current controls value. Eh, my 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 :D