| View previous topic :: View next topic |
| Author |
Message |
NLI-Conquer Guest
|
Posted: Fri Mar 19, 2010 5:53 am Post subject: COM Invoke Problem |
|
|
---------------------------
COM Error Notification
---------------------------
Function Name: "InstantMessage"
ERROR: The COM Object may not be a valid Dispatch Object!
First ensure that COM Library has been initialized through COM_Init().
()
Will Continue?
---------------------------
Yes No
---------------------------
Using this code from somewhere on this forum:
| Code: | #Include COM.ahk
stat = 4
COM_Init()
Msn := COM_CreateObject("Messenger.UIAutomation.1")
COM_Invoke(msn, "InstantMessage", "AFriendOfMine@hotmail.com")
COM_Release(pwb), COM_Term()
Return |
Can anyone shed light on this problem? |
|
| Back to top |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 2462
|
|
| Back to top |
|
 |
sinkfaze
Joined: 18 Mar 2008 Posts: 5044 Location: the tunnel(?=light)
|
Posted: Fri Mar 19, 2010 6:33 am Post subject: |
|
|
You've got some of the right parts anyway:
| Code: | #Include COM.ahk
stat = 4
COM_Init()
Msn := COM_CreateObject("Messenger.UIAutomation.1","",stat)
COM_Invoke(msn, "InstantMessage", "AFriendOfMine@hotmail.com")
COM_Release(msn), COM_Term() ; make sure you're releasing the correct object pointer
Return |
_________________ Try Quick Search for Autohotkey or see the tutorial for newbies. |
|
| Back to top |
|
 |
NLI-Conquer Guest
|
Posted: Fri Mar 19, 2010 8:35 am Post subject: |
|
|
| Thx guys! |
|
| Back to top |
|
 |
Murx Guest
|
Posted: Fri Mar 19, 2010 9:49 am Post subject: |
|
|
| Code: | ---------------------------
COM Error Notification
---------------------------
Function Name: "InstantMessage"
ERROR: The COM Object may not be a valid Dispatch Object!
First ensure that COM Library has been initialized through COM_Init().
()
Will Continue?
---------------------------
Yes No
--------------------------- | Same error for sinkface's code snippet XPpro/SP3/IE6 |
|
| Back to top |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 2462
|
Posted: Fri Mar 19, 2010 10:04 am Post subject: |
|
|
| Code: | COM_Init()
msn := COM_CreateObject("Messenger.UIAutomation","",4) |
|
|
| Back to top |
|
 |
Murx Guest
|
Posted: Fri Mar 19, 2010 10:44 am Post subject: |
|
|
Nope. Same error again.
Btw, I'm using MICROSOFT OFFICE COMMUNICATOR 2005. So to assume that it makes no difference because its "the messenger" is valid, right? |
|
| Back to top |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 2462
|
Posted: Fri Mar 19, 2010 12:33 pm Post subject: |
|
|
| Looks like Messenger is altered/disabled. Check the registry entry HKCR\Messenger.UIAutomation. |
|
| Back to top |
|
 |
Murx Guest
|
Posted: Fri Mar 19, 2010 1:24 pm Post subject: |
|
|
| Code: | HKCR\Messenger.UIAutomation.
CLSID
CurVer
HKCR\Messenger.UIAutomation.1
CLSID | Subkeys existing. No indicators (IMHO) that something is missing or disabled. Btw, Communicator itself is working fine. |
|
| Back to top |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 2462
|
Posted: Fri Mar 19, 2010 3:26 pm Post subject: |
|
|
| You have to inspect the specified CLSID key too, HKCR\CLSID\{...}. BTW, it's the first time I heard about Communicator. |
|
| Back to top |
|
 |
Murx Guest
|
|
| Back to top |
|
 |
Jeremiah
Joined: 20 Apr 2009 Posts: 797 Location: North Dakota, USA
|
Posted: Fri Mar 19, 2010 3:48 pm Post subject: |
|
|
Yeah, I didn't know about Communicator until I started working for the company I work for now. I'm not sure if it's any help whatsoever, but in the code I'm seeing
This can't work if you're using Communicator? _________________ -Jeremiah |
|
| Back to top |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 2462
|
Posted: Fri Mar 19, 2010 4:20 pm Post subject: |
|
|
No, I meant you had to inspect the key HKCR\CLSID\{B69003B3-C55E-4b48-836C-BC5946FC3B28}.
BTW, I'm suspecting Communicator disables/replaces Messenger or its derivatives, so creating Messenger.UIAutomation will be failed once Communicator is installed. |
|
| Back to top |
|
 |
sinkfaze
Joined: 18 Mar 2008 Posts: 5044 Location: the tunnel(?=light)
|
Posted: Fri Mar 19, 2010 4:23 pm Post subject: |
|
|
msn in this instance is just a variable containing the object reference, so that doesn't really affect anything. What may affect things is trying to retrieve a reference to an object that doesn't exist.
@ Murx
Run this and tell us what the message box produces:
| Code: | #Include COM.ahk
stat = 4
obj=Messenger.UIAutomation
COM_Init()
MsgBox % msn := COM_CreateObject(obj,"",stat)
. "`n" msn1 := COM_CreateObject( obj ".1","",stat)
COM_Release(msn1), COM_Release(msn), COM_Term()
Return |
_________________ Try Quick Search for Autohotkey or see the tutorial for newbies. |
|
| Back to top |
|
 |
Murx Guest
|
Posted: Fri Mar 19, 2010 4:26 pm Post subject: |
|
|
| Quote: | | Run this and tell us what the message box produces: |
0
0
 |
|
| Back to top |
|
 |
|