I think the problem is just the MSN documentation...The pythoncom stuff is working as expected. To make things a little easier, I recommend using the MakePy in pythonwin. It will create a .py file that helps a small amount when trying to figure out what functions and such you need to call. I renamed the output file to msn.py and ran the following:
import msn mapp = msn.Messenger() person = mapp.GetContact("[EMAIL PROTECTED]",mapp.MyServiceId) imsg = b.InstanteMessage(person) No clue how to send a message from here...I recommend just googling on these function names and you'll end up seeing some VB code, but the same function calls usually work pretty similarly in python On 8/17/06, Indy LIU <[EMAIL PROTECTED]> wrote: > Hi, > > Thank you for the reply. I think it comes down to my lack of knowledge > about using COM objects. > > C++ is my native programming language and I've done some python. But the > whole COM thing is totally new to me. Unfortunately, as you probably > have found out most PythonCom examples are about word, excel or outlook. > It's really hard to extend those examples to other COM objects when > there's no clear instruction but 'go to MSDN or use the COM Browser'. To > make matters worse the MSN API was poorly documented. For example the > only COM object that visibly starts my MSN Messenger Client is > 'Messenger.MessengerApp' but on the website it says 'not supported'. > > Can you just give me a simple example as to how I can invoke the > 'IMessenger' Interface and use a method such as 'GetContact'? I'm sure > it'll benefit the whole pythonwin/MSN community immensely.(After over 4 > hours search I'm 80% sure there's no tutorial about pythoncom and MSN > messenger. It's clearly a gap.) > > Cheers. > > Kevin Patterson wrote: > > Have you tried the MSDN help on this COM Module? Mmmmm...actually > > after looking through the docs, maybe its not a whole lot of help. I > > see a lot of "Not Currently Supported" statements. Well, here's the > > link anyway in case there's something there: > > > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winmessenger/winmessenger/reference/messengeruasdk/ifaces/imessenger/instantmessage.asp > > <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winmessenger/winmessenger/reference/messengeruasdk/ifaces/imessenger/instantmessage.asp> > > > > > > On 8/15/06, *Indy Liu* <[EMAIL PROTECTED] > > <mailto:[EMAIL PROTECTED]>> wrote: > > > > I need to write a plug-in for MSN Messenger in python. All it does is > > analyze a new message string and does some string ops on it. Can some > > body please give me some tips as to how I achieve this with win32com? > > > > I managed to obtain the messenger API type library as follows, and > > just > > don't know what to do from here. > > " > > >>> MSN = > > gencache.EnsureModule('{E02AD29E-80F5-46c6-B416-9B3EBDDF057E}', 0, > > 1, 0) > > >>> dir(MSN) > > ['CLSID', 'CLSIDToClassMap', 'CLSIDToPackageMap', 'CoClassBaseClass', > > 'DMessengerEvents', 'Dispatch', 'DispatchBaseClass', 'IID', > > 'IMessenger', 'IMessenger2', 'IMessenger2_vtables_', > > 'IMessenger2_vtables_dispatch_', 'IMessenger3', > > 'IMessenger3_vtables_', > > 'IMessenger3_vtables_dispatch_', 'IMessengerContact', > > 'IMessengerContact_vtables_', 'IMessengerContact_vtables_dispatch_', > > 'IMessengerContacts', 'IMessengerContacts_vtables_', > > 'IMessengerContacts_vtables_dispatch_', 'IMessengerConversationWnd', > > 'IMessengerConversationWnd_vtables_', > > 'IMessengerConversationWnd_vtables_dispatch_', 'IMessengerGroup', > > 'IMessengerGroup_vtables_', 'IMessengerGroup_vtables_dispatch_', > > 'IMessengerGroups', 'IMessengerGroups_vtables_', > > 'IMessengerGroups_vtables_dispatch_', 'IMessengerService', > > 'IMessengerService_vtables_', 'IMessengerService_vtables_dispatch_', > > 'IMessengerServices', 'IMessengerServices_vtables_', > > 'IMessengerServices_vtables_dispatch_', 'IMessengerWindow', > > 'IMessengerWindow_vtables_', 'IMessengerWindow_vtables_dispatch_', > > 'IMessenger_vtables_', 'IMessenger_vtables_dispatch_', 'LCID', > > 'LibraryFlags', 'MajorVersion', 'Messenger', 'MessengerNative', > > 'MinorVersion', 'NamesToIIDMap', 'RecordMap', 'VTablesToClassMap', > > 'VTablesToPackageMap', '__builtins__', '__doc__', '__file__', > > '__name__', '_in_gencache_', 'constants', 'defaultNamedNotOptArg', > > 'defaultNamedOptArg', 'defaultUnnamedArg', 'makepy_version', > > 'python_version', 'pythoncom', 'win32com'] > > " > > > > I don't want to use msnp.py since it requires the user to log in with > > msnp session manually as well as their MSN Messenger. I did hours of > > search online and the conclusion is posting & crying for help in this > > forum is really my best bet. > > > > Thanks. > > > > _______________________________________________ > > Python-win32 mailing list > > Python-win32@python.org <mailto:Python-win32@python.org> > > http://mail.python.org/mailman/listinfo/python-win32 > > > > > > _______________________________________________ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32