Click here to Skip to main content
15,895,799 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Redimension CComboBox Pin
Cool_Dev29-Sep-10 4:18
Cool_Dev29-Sep-10 4:18 
GeneralRe: Redimension CComboBox Pin
mesajflaviu29-Sep-10 8:15
mesajflaviu29-Sep-10 8:15 
AnswerRe: Redimension CComboBox Pin
Rolf Kristensen29-Sep-10 9:44
Rolf Kristensen29-Sep-10 9:44 
GeneralRe: Redimension CComboBox Pin
mesajflaviu30-Sep-10 20:09
mesajflaviu30-Sep-10 20:09 
QuestionWindows Service cannot access mapped network drive Pin
Ranojay28-Sep-10 21:43
Ranojay28-Sep-10 21:43 
AnswerRe: Windows Service cannot access mapped network drive Pin
Sauro Viti28-Sep-10 21:53
professionalSauro Viti28-Sep-10 21:53 
GeneralRe: Windows Service cannot access mapped network drive Pin
Ranojay28-Sep-10 22:31
Ranojay28-Sep-10 22:31 
AnswerRe: Windows Service cannot access mapped network drive Pin
Kushagra Tiwari29-Sep-10 1:45
Kushagra Tiwari29-Sep-10 1:45 
Hi,

The reason why you are able to access the drive in when you normally run the executable from command prompt is that when u are executing it as normal exe you are running that application in the User account from which you have logged on . And that user has the privileges to access the network. But , when you install the executable as a service , by default if you see in the task manage it runs under 'SYSTEM' account . And you might be knowing that the 'SYSTEM' doesn't have rights to access network resources.

There can be two solutions to this problem.

1. As Sauro Viti already pointed out in the link he gave you , to map the drive as persistent.

2. There is one more approach that can be followed. If you open the service manager by typing in the 'services.msc'you can go to your service and in the properties of your service there is a logOn tab where you can specify the account as any other account than 'System' you can either start service from your own logged on user account or through 'Network Service'. When you do this .. the service can access any network component and drive even if they are not persistent also.
To achieve this programmatically you can look into 'CreateService' function at
http://msdn.microsoft.com/en-us/library/ms682450(v=vs.85).aspx and can set the parameter 'lpServiceStartName ' to 'NT AUTHORITY\NetworkService'. This will start your service under 'Network Service' account and then you are done.




3. You can also try by making the service as interactive by specifying SERVICE_INTERACTIVE_PROCESS in the servicetype parameter flag of your CreateService() function but this will be limited only till XP as Vista and 7 donot support this feature.

Hope the solutions help you.. Let me know if this worked for you .

-Kushagra
GeneralRe: Windows Service cannot access mapped network drive Pin
Ranojay29-Sep-10 2:11
Ranojay29-Sep-10 2:11 
AnswerRe: Windows Service cannot access mapped network drive [modified] Pin
Kushagra Tiwari29-Sep-10 3:01
Kushagra Tiwari29-Sep-10 3:01 
QuestionHow to get the co-ordinates of rectangle Pin
raju_shiva28-Sep-10 21:10
raju_shiva28-Sep-10 21:10 
AnswerRe: How to get the co-ordinates of rectangle Pin
Stephen Hewitt28-Sep-10 21:17
Stephen Hewitt28-Sep-10 21:17 
GeneralRe: How to get the co-ordinates of rectangle Pin
raju_shiva28-Sep-10 23:14
raju_shiva28-Sep-10 23:14 
GeneralRe: How to get the co-ordinates of rectangle Pin
Stephen Hewitt29-Sep-10 0:25
Stephen Hewitt29-Sep-10 0:25 
QuestionOutlook bar with variable number of controls fails to draw Pin
old_hacker28-Sep-10 17:48
old_hacker28-Sep-10 17:48 
QuestionHow to get control of another code's dialog box Pin
largenqcd28-Sep-10 16:17
largenqcd28-Sep-10 16:17 
AnswerRe: How to get control of another code's dialog box [modified] Pin
Luc Pattyn28-Sep-10 16:35
sitebuilderLuc Pattyn28-Sep-10 16:35 
GeneralRe: How to get control of another code's dialog box Pin
largenqcd29-Sep-10 13:11
largenqcd29-Sep-10 13:11 
QuestionHow to make the release version of a visual studio 2008 c++ project so i can step in and debug? Pin
ns28-Sep-10 10:13
ns28-Sep-10 10:13 
AnswerRe: How to make the release version of a visual studio 2008 c++ project so i can step in and debug? Pin
Aescleal28-Sep-10 10:39
Aescleal28-Sep-10 10:39 
GeneralRe: How to make the release version of a visual studio 2008 c++ project so i can step in and debug? Pin
ns28-Sep-10 10:51
ns28-Sep-10 10:51 
GeneralRe: How to make the release version of a visual studio 2008 c++ project so i can step in and debug? Pin
Eugen Podsypalnikov28-Sep-10 11:57
Eugen Podsypalnikov28-Sep-10 11:57 
GeneralRe: How to make the release version of a visual studio 2008 c++ project so i can step in and debug? Pin
Tim Craig28-Sep-10 15:05
Tim Craig28-Sep-10 15:05 
GeneralRe: How to make the release version of a visual studio 2008 c++ project so i can step in and debug? Pin
Eugen Podsypalnikov28-Sep-10 20:41
Eugen Podsypalnikov28-Sep-10 20:41 
GeneralRe: How to make the release version of a visual studio 2008 c++ project so i can step in and debug? Pin
ns29-Sep-10 4:31
ns29-Sep-10 4:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.