AutoHotkey Community

It is currently May 27th, 2012, 3:02 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 30 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: COM Invoke Problem
PostPosted: March 19th, 2010, 6:53 am 
---------------------------
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?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 19th, 2010, 7:19 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 19th, 2010, 7:33 am 
Offline
User avatar

Joined: March 19th, 2008, 12:43 am
Posts: 5480
Location: the tunnel(?=light)
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

_________________
Image
Try Quick Search for Autohotkey or see the tutorial for newbies.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 19th, 2010, 9:35 am 
Thx guys!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 19th, 2010, 10:49 am 
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 :shock: XPpro/SP3/IE6


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 19th, 2010, 11:04 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
Code:
COM_Init()
msn := COM_CreateObject("Messenger.UIAutomation","",4)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 19th, 2010, 11:44 am 
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?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 19th, 2010, 1:33 pm 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
Looks like Messenger is altered/disabled. Check the registry entry HKCR\Messenger.UIAutomation.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 19th, 2010, 2:24 pm 
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.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 19th, 2010, 4:26 pm 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
You have to inspect the specified CLSID key too, HKCR\CLSID\{...}. BTW, it's the first time I heard about Communicator.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 19th, 2010, 4:47 pm 
for both the CLSID is: {B69003B3-C55E-4b48-836C-BC5946FC3B28}

for your convinience: http://en.wikipedia.org/wiki/Microsoft_ ... mmunicator


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 19th, 2010, 4:48 pm 
Offline

Joined: April 20th, 2009, 1:10 pm
Posts: 817
Location: North Dakota, USA
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 19th, 2010, 5:20 pm 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 19th, 2010, 5:23 pm 
Offline
User avatar

Joined: March 19th, 2008, 12:43 am
Posts: 5480
Location: the tunnel(?=light)
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

_________________
Image
Try Quick Search for Autohotkey or see the tutorial for newbies.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 19th, 2010, 5:26 pm 
Quote:
Run this and tell us what the message box produces:


0
0

:)


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 30 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: rbrtryn and 29 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group