Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_nt_services thread: Re: send() and recv() calls fail in atl service project


Message #1 by "tom dial" <tom.dial@o...> on Thu, 27 Feb 2003 07:55:38
Open the service manager and try changing the account that
the service logs in as.  By default, the service will
be installed to run under the LocalSystem account.  I don't
know if this definitely your problem, but it's worth a try.

1. In the service manager, right click on your service and
select properties. 
2. Select the 'Log On' tab. 
3. Click the "This account" radio buttin
4. Click Browse, and and select your domain user account,
   assuming that that's how you log in. Otherwise pick your
   login from the local machine.
5. Enter your password (twice).
6. Click apply and OK.
7. restart and try again.

PS - If using MAPI to send mail, you need to use the MAPI_NT_SERVICE
flag when calling MAPIInitialize()


> Hi, 
> 
> 
> I have a socket function that sends an email. I'm using VC++ 6.0
> 
> It works perfectly well in a Win32 Console Application but when I put 
the 
> function into my ATL COM, type: service, it does not send the mail. I 
have 
> put the wsock32.lib into the service app and I think everything else is 
> the same. It connects successfully but returns -1 for every recv() and 
send
> () call.
> 
> 
> Can you help?
> 
> Cheers.

  Return to Index