I've got two programs : A and B
A has code to map a network drive using WNetAddConnection2.
This works fine if I start program a from the command line.
Program B is a NT-service. It's a scheduler which starts other programs according a time-schedule configuration. Program A is a program that is startet from within program B from time to time. Program B starts program A using: _spawnvp(_P_WAIT, CommandFile, Args);
If progam A is started that way by B, the WNetAddConnection2 method in porgam A returns error 1312 (A specified logon session does not exist. It may already have been terminated.
It must have to do that A and B have different sessions?
Do I have to use another method, than _spawnvp to start porgam A?
thanks for help martin