MAPI and NT Service

Michel Orengo michelorengo at netscape.com
Mon Jan 24 17:19:43 EST 2000


Has anyone ever try to access MAPI within an NT Service?

I have a script that send messages thru MAPI and works fine when run
from the console.
I made a NT service of it, and it still runs fine with:
'python mapiService.py debug'
(not surprising since os.system is called)

BUT when I tried to start the service, I have the following error on the
line Session.Logon(...)

 File "C:\Program Files\Python\win32\lib\win32serviceutil.py", line 597,
in SvcRun
    self.SvcDoRun()
  File "G:\MyProjects\Mapi\mapiService.py", line 24, in SvcDoRun
    self.session.Logon(profileName="Michel
Orengo",profilePassword="561o1",showDialog=0, parentWindow=-1)
  File "C:\Program
Files\Python\win32com\gen_py\3FA7DEA7-6438-101B-ACC1-00AA00423326x0x1x0.py",
line 696, in Logon
    return self._ApplyTypes_(0x77, 1, (12, 0), ((12, 17), (12, 17), (12,
17), (12, 17), (12, 17)), 'Logon', None, profileName, profilePassword,
showDialog, newSession, parentWindow)
  File "C:\Program
Files\Python\win32com\gen_py\3FA7DEA7-6438-101B-ACC1-00AA00423326x0x1x0.py",
line 93, in _ApplyTypes_
    return self._get_good_object_(apply(self._oleobj_.InvokeTypes,
(dispid, LCID, wFlags, retType, argTypes) + args), user, resultCLSID),
pywintypes.com_error, (-2147221246, 'Invalid window handle', (1258,
'OLE/Messaging', ' [OLE/Messaging - [80040102]]', None, 0, -2147221246),
None).

I don't understand this com_error 'Invalid window handle'.
Any pointer will be greatly appreciated

BTW, how/where can I get an a plain english description of the com
error?

Thanks
Michel




More information about the Python-list mailing list