Click here to Skip to main content
15,889,931 members
Home / Discussions / Windows Forms
   

Windows Forms

 
AnswerRe: Project Pin
Paul Conrad30-Nov-07 9:25
professionalPaul Conrad30-Nov-07 9:25 
AnswerRe: Project Pin
Sathesh Sakthivel1-Dec-07 1:58
Sathesh Sakthivel1-Dec-07 1:58 
Questionproblem with MDI form Pin
Sipder29-Nov-07 18:20
Sipder29-Nov-07 18:20 
AnswerRe: problem with MDI form Pin
led mike30-Nov-07 5:54
led mike30-Nov-07 5:54 
AnswerRe: problem with MDI form Pin
Pete O'Hanlon30-Nov-07 11:27
mvePete O'Hanlon30-Nov-07 11:27 
GeneralRe: problem with MDI form Pin
Sipder30-Nov-07 22:10
Sipder30-Nov-07 22:10 
AnswerRe: problem with MDI form Pin
zhangdelin30-Nov-07 17:48
zhangdelin30-Nov-07 17:48 
QuestionChanging the User account of a Service dynamically Pin
nlharshini28-Nov-07 7:11
nlharshini28-Nov-07 7:11 
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
SC_HANDLE schSCManager, service;
schSCManager = OpenSCManager(szServerDNS,
NULL,
SC_MANAGER_CONNECT );
ervice = OpenService(schSCManager,
TEXT(SZSERVICENAME),
SERVICE_ALL_ACCESS);
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();
}
}

AnswerRe: Changing the User account of a Service dynamically Pin
led mike28-Nov-07 9:52
led mike28-Nov-07 9:52 
AnswerRe: Changing the User account of a Service dynamically Pin
Ravi Bhavnani30-Nov-07 6:26
professionalRavi Bhavnani30-Nov-07 6:26 
QuestionWindows Form as Control in DLL Pin
Mike Kitchen28-Nov-07 5:23
Mike Kitchen28-Nov-07 5:23 
AnswerRe: Windows Form as Control in DLL Pin
DigiOz Multimedia28-Nov-07 6:07
DigiOz Multimedia28-Nov-07 6:07 
GeneralRe: Windows Form as Control in DLL Pin
Mike Kitchen28-Nov-07 6:11
Mike Kitchen28-Nov-07 6:11 
GeneralRe: Windows Form as Control in DLL Pin
DigiOz Multimedia28-Nov-07 6:25
DigiOz Multimedia28-Nov-07 6:25 
GeneralRe: Windows Form as Control in DLL Pin
led mike28-Nov-07 6:51
led mike28-Nov-07 6:51 
GeneralRe: Windows Form as Control in DLL Pin
Mike Kitchen28-Nov-07 22:30
Mike Kitchen28-Nov-07 22:30 
GeneralRe: Windows Form as Control in DLL Pin
led mike29-Nov-07 4:31
led mike29-Nov-07 4:31 
GeneralRe: Windows Form as Control in DLL Pin
Mike Kitchen29-Nov-07 5:19
Mike Kitchen29-Nov-07 5:19 
QuestionWeb application download causes an old version of the app to run Pin
Rich Leyshon28-Nov-07 3:58
Rich Leyshon28-Nov-07 3:58 
QuestionCrystal report Pin
Nadi.R27-Nov-07 20:08
Nadi.R27-Nov-07 20:08 
AnswerThe easiest way Pin
Ennis Ray Lynch, Jr.28-Nov-07 8:43
Ennis Ray Lynch, Jr.28-Nov-07 8:43 
Questionjoyastick Pin
ellllllllie27-Nov-07 4:22
ellllllllie27-Nov-07 4:22 
AnswerRe: joyastick Pin
originSH27-Nov-07 5:58
originSH27-Nov-07 5:58 
GeneralRe: joyastick Pin
Paul Conrad30-Nov-07 9:26
professionalPaul Conrad30-Nov-07 9:26 
QuestionON_UPDATE_COMMAND_UI in WinForms ? Pin
besmel26-Nov-07 23:18
besmel26-Nov-07 23:18 

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.