Click here to Skip to main content
15,898,134 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionlink error with DirectShow Pin
mwolf12227-Nov-07 22:23
mwolf12227-Nov-07 22:23 
AnswerRe: link error with DirectShow Pin
Amar Sutar27-Nov-07 23:19
Amar Sutar27-Nov-07 23:19 
GeneralRe: link error with DirectShow Pin
mwolf12228-Nov-07 16:04
mwolf12228-Nov-07 16:04 
QuestionWix installer Pin
Abhi Lahare27-Nov-07 21:53
Abhi Lahare27-Nov-07 21:53 
AnswerRe: Wix installer Pin
ThatsAlok27-Nov-07 22:45
ThatsAlok27-Nov-07 22:45 
JokeRe: Wix installer Pin
Nelek27-Nov-07 23:16
protectorNelek27-Nov-07 23:16 
GeneralRe: Wix installer Pin
ThatsAlok27-Nov-07 23:27
ThatsAlok27-Nov-07 23:27 
QuestionChanging the User account of a Service dynamically Pin
nlharshini27-Nov-07 21:38
nlharshini27-Nov-07 21:38 
Hi,

I have created a service not specifying the username/credentails i.e. local-account. I am trying to change the user to "domain\username" dynamically using ChangeServiceConfig API. This API always returns me error code 87 i.e. “The parameter is incorrect”.

I have explained the problem below. Does anyone why this behavior?

I have detailed the steps below:

I have an issue. I create a service under the local system account. After that I am trying to change the user to domain\user. E.g.: if my domain name is “MSDN” and username name is “me”, I am trying to change the user credentials to “MSDN\me” using the ChangeServiceConfig API. This API is always throwing me an error 87 i.e. “The parameter is incorrect”.



#define SZSERVICENAME “Trial”
ServiceCreate()
{
schSCManager = OpenSCManager(NULL, // machine (NULL == local)
NULL, // database (NULL == default)
SC_MANAGER_CONNECT | SC_MANAGER_CREATE_SERVICE // access required
);

schService = CreateService(schSCManager, // SCManager database
TEXT(SZSERVICENAME), // name of service
TEXT(SZSERVICENAME), // name to display
SERVICE_ALL_ACCESS, // desired access
SERVICE_INTERACTIVE_PROCESS|SERVICE_WIN32_OWN_PROCESS, // service type
SERVICE_AUTO_START, //SERVICE_DEMAND_START start type
SERVICE_ERROR_NORMAL, // error control type
szPath, // service's binary
NULL, // no load ordering group
NULL, // no tag identifier
TEXT(SZDEPENDENCIES), // dependencies
NULL, // LocalSystem account
NULL); // no password
}

ChangeServiceParms()

{
//Domain = “msdn.try.com”, computer name is “comp”
LPTSTR szServerDNS = “comp.msdn.try.com”;//Fullname of the computer
LPTSTR szAccountDN = “MSDN\me”;// User to which I am trying to logon
schSCManager = OpenSCManager(szServerDNS,
NULL,
SC_MANAGER_CONNECT );

BOOL success = ChangeServiceConfig(service,
SERVICE_NO_CHANGE,
SERVICE_NO_CHANGE,
SERVICE_NO_CHANGE,
NULL,
NULL,
NULL,
NULL,
szAccountDN,
NULL,
NULL);
if(!success)
{

DWORD err = GetLastError();
}
}


QuestionInstall postgreSQL from MFC application? [modified] Pin
$uresh $hanmugam27-Nov-07 21:11
$uresh $hanmugam27-Nov-07 21:11 
QuestionRadio Buttons and Group Boxes Pin
XChibi27-Nov-07 21:10
XChibi27-Nov-07 21:10 
AnswerRe: Radio Buttons and Group Boxes Pin
Nelek27-Nov-07 22:16
protectorNelek27-Nov-07 22:16 
AnswerRe: Radio Buttons and Group Boxes Pin
Marimuthu.r27-Nov-07 22:39
Marimuthu.r27-Nov-07 22:39 
Questionchar** Pin
nitin327-Nov-07 21:05
nitin327-Nov-07 21:05 
AnswerRe: char** Pin
CPallini27-Nov-07 21:25
mveCPallini27-Nov-07 21:25 
GeneralRe: char** Pin
nitin327-Nov-07 22:30
nitin327-Nov-07 22:30 
GeneralRe: char** Pin
ThatsAlok27-Nov-07 22:52
ThatsAlok27-Nov-07 22:52 
GeneralRe: char** Pin
sumd27-Nov-07 23:06
sumd27-Nov-07 23:06 
AnswerRe: char** Pin
toxcct27-Nov-07 22:41
toxcct27-Nov-07 22:41 
GeneralRe: char** Pin
ThatsAlok27-Nov-07 22:51
ThatsAlok27-Nov-07 22:51 
GeneralRe: char** Pin
toxcct27-Nov-07 23:04
toxcct27-Nov-07 23:04 
GeneralRe: char** Pin
ThatsAlok27-Nov-07 23:26
ThatsAlok27-Nov-07 23:26 
AnswerRe: char** Pin
ThatsAlok27-Nov-07 22:50
ThatsAlok27-Nov-07 22:50 
GeneralRe: char** Pin
toxcct27-Nov-07 23:04
toxcct27-Nov-07 23:04 
GeneralRe: char** Pin
ThatsAlok27-Nov-07 23:30
ThatsAlok27-Nov-07 23:30 
QuestionProblem with IE7 Pin
sumd27-Nov-07 21:03
sumd27-Nov-07 21:03 

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.