Click here to Skip to main content
15,899,825 members
Home / Discussions / Windows Forms
   

Windows Forms

 
GeneralRe: Browsing a ListBox Pin
benqazou30-Dec-07 23:33
benqazou30-Dec-07 23:33 
GeneralCan't serialize a property to InitializeComponent() Pin
ctoma200522-Dec-07 12:13
ctoma200522-Dec-07 12:13 
GeneralRe: Can't serialize a property to InitializeComponent() Pin
ctoma200527-Dec-07 2:45
ctoma200527-Dec-07 2:45 
GeneralRe: Can't serialize a property to InitializeComponent() Pin
DigiOz Multimedia28-Dec-07 8:43
DigiOz Multimedia28-Dec-07 8:43 
QuestionWindows Application Pin
jaguar_142030-Nov-07 21:19
jaguar_142030-Nov-07 21:19 
GeneralRe: Windows Application Pin
Christian Graus22-Dec-07 16:31
protectorChristian Graus22-Dec-07 16:31 
QuestionProject Pin
mwanyu30-Nov-07 1:44
mwanyu30-Nov-07 1:44 
Answercross-post Pin
led mike30-Nov-07 5:56
led mike30-Nov-07 5:56 
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 

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.