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 Invoke Problem
Goto page 1, 2  Next
 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
NLI-Conquer
Guest





PostPosted: Fri Mar 19, 2010 5:53 am    Post subject: COM Invoke Problem Reply with quote

---------------------------
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

PostPosted: Fri Mar 19, 2010 6:19 am    Post subject: Reply with quote

I guess you're on XP. This behavior is no longer present in Win7 with Windows Live Messenger. Anyway, read the thread:
http://www.autohotkey.com/forum/viewtopic.php?t=36189
Back to top
View user's profile Send private message
sinkfaze



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

PostPosted: Fri Mar 19, 2010 6:33 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
NLI-Conquer
Guest





PostPosted: Fri Mar 19, 2010 8:35 am    Post subject: Reply with quote

Thx guys!
Back to top
Murx
Guest





PostPosted: Fri Mar 19, 2010 9:49 am    Post subject: Reply with quote

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 Shocked XPpro/SP3/IE6
Back to top
Sean



Joined: 12 Feb 2007
Posts: 2462

PostPosted: Fri Mar 19, 2010 10:04 am    Post subject: Reply with quote

Code:
COM_Init()
msn := COM_CreateObject("Messenger.UIAutomation","",4)
Back to top
View user's profile Send private message
Murx
Guest





PostPosted: Fri Mar 19, 2010 10:44 am    Post subject: Reply with quote

Nope. Same error again. Sad
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

PostPosted: Fri Mar 19, 2010 12:33 pm    Post subject: Reply with quote

Looks like Messenger is altered/disabled. Check the registry entry HKCR\Messenger.UIAutomation.
Back to top
View user's profile Send private message
Murx
Guest





PostPosted: Fri Mar 19, 2010 1:24 pm    Post subject: Reply with quote

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

PostPosted: Fri Mar 19, 2010 3:26 pm    Post subject: Reply with quote

You have to inspect the specified CLSID key too, HKCR\CLSID\{...}. BTW, it's the first time I heard about Communicator.
Back to top
View user's profile Send private message
Murx
Guest





PostPosted: Fri Mar 19, 2010 3:47 pm    Post subject: Reply with quote

for both the CLSID is: {B69003B3-C55E-4b48-836C-BC5946FC3B28}

for your convinience: http://en.wikipedia.org/wiki/Microsoft_Office_Communicator
Back to top
Jeremiah



Joined: 20 Apr 2009
Posts: 797
Location: North Dakota, USA

PostPosted: Fri Mar 19, 2010 3:48 pm    Post subject: Reply with quote

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
Code:
COM_Invoke(msn...

This can't work if you're using Communicator?
_________________
-Jeremiah
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Sean



Joined: 12 Feb 2007
Posts: 2462

PostPosted: Fri Mar 19, 2010 4:20 pm    Post subject: Reply with quote

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
View user's profile Send private message
sinkfaze



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

PostPosted: Fri Mar 19, 2010 4:23 pm    Post subject: Reply with quote

Code:
COM_Invoke(msn...


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
View user's profile Send private message Send e-mail
Murx
Guest





PostPosted: Fri Mar 19, 2010 4:26 pm    Post subject: Reply with quote

Quote:
Run this and tell us what the message box produces:


0
0

Smile
Back to top
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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