|
-
April 27th, 1999, 04:14 AM
#1
OLE and NT Service
Hi
I have written an console application that requires the use of MAPI and OLE. After testing my program, I feel that instead of a console application, I should have changed it to a NT service instead. So I got the code CNTService.cpp, .h and relevant files and start to change my original program. Now I am stuck as OLE does not work as desired. I know that there is nothing wrong with my code, as a console application, its working. My question is, is there any speical considerations when using OLE and even MAPI in a NT Service. If yes, what are the things to note.
-
May 6th, 1999, 02:09 PM
#2
Re: OLE and NT Service
You aren't alone with this problem. I'm trying to use ODBC from within an NT Service and have run into the same problem. My program works fine as a console but fails as a service. I suspect it has something to do with the initialization of the OLE libraries from within a service. AfxWinInit() might play a role here but I don't know. Just have to keep sifting through the **** Microsoft calls documentation.
Freedom is knowing you can burn all your software without losing a minute's sleep.
-
July 8th, 2005, 04:29 AM
#3
Re: OLE and NT Service
In case anyone comes across this post while searching (as I did), this might be useful. You may find that you have to explicitly initialise COM security when running as a service, but not when running as an application. The following code may help:
Code:
CoInitializeSecurity(NULL, -1, NULL, NULL, RPC_C_AUTHN_LEVEL_DEFAULT,
RPC_C_IMP_LEVEL_IDENTIFY, NULL, 0, NULL);
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|