Click here to Skip to main content
15,920,801 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCDatabase's ExecuteQuery Pin
prithaa21-Nov-07 20:19
prithaa21-Nov-07 20:19 
AnswerRe: CDatabase's ExecuteQuery Pin
Gofur Halmurat22-Nov-07 1:48
Gofur Halmurat22-Nov-07 1:48 
GeneralRe: CDatabase's ExecuteQuery Pin
prithaa22-Nov-07 20:28
prithaa22-Nov-07 20:28 
GeneralRe: CDatabase's ExecuteQuery Pin
Gofur Halmurat23-Nov-07 2:46
Gofur Halmurat23-Nov-07 2:46 
QuestionProblem while Running the Application in Release Configuration Pin
ss43121-Nov-07 20:15
ss43121-Nov-07 20:15 
AnswerRe: Problem while Running the Application in Release Configuration Pin
Cedric Moonen21-Nov-07 20:29
Cedric Moonen21-Nov-07 20:29 
AnswerRe: Problem while Running the Application in Release Configuration Pin
only coder21-Nov-07 20:38
only coder21-Nov-07 20:38 
Questionproblem retrieving service failure action Pin
nitin321-Nov-07 19:51
nitin321-Nov-07 19:51 
i configured fisrt service failure action of "alerter" servie as "Action Run Command" with commandline "C:\\myfile.exe" ,using services.msc under winxp .
i tried to retrieve the filename using the following code ...

int main()
{

	BYTE* Buf = NULL ;	
	DWORD dwNeeded	= 0 , dw = 0 ;

	SC_HANDLE hSCManager , hService ;
	
	hSCManager	= OpenSCManager( NULL , SERVICES_ACTIVE_DATABASE , SC_MANAGER_ALL_ACCESS ) ;
	hService	= OpenService( hSCManager , "Alerter" , SERVICE_ALL_ACCESS ) ;

	QueryServiceConfig2( hService , SERVICE_CONFIG_FAILURE_ACTIONS , (LPBYTE)Buf , 0 , &dwNeeded ) ;
	
	printf( "BufSize = %d\n" , dwNeeded ) ;

	Buf = new BYTE[ dwNeeded ] ;
	
	if( QueryServiceConfig2( hService , SERVICE_CONFIG_FAILURE_ACTIONS , (LPBYTE)Buf , dwNeeded , &dw ) )
	{
		for( int i = 0 ; i < ((SERVICE_FAILURE_ACTIONS*)Buf)->cActions ; i ++ ) 
		{
			if( ((SERVICE_FAILURE_ACTIONS*)Buf)->lpsaActions[ i ].Type == SC_ACTION_RUN_COMMAND )
			{			
				if( ((SERVICE_FAILURE_ACTIONS*)Buf)->lpCommand )
				{
					printf( "Actions : %d\nFile : %s\n" , ((SERVICE_FAILURE_ACTIONS*)Buf)->cActions , ((SERVICE_FAILURE_ACTIONS*)Buf)->lpCommand ) ;
				}

			}
		}
	}

	printf( "%d" , (sizeof(SC_ACTION) )) ;

	if( Buf )
		delete[] Buf ;

	CloseServiceHandle( hService ) ;
	CloseServiceHandle( hSCManager ) ;
}


i got the output

BufSize = 78
Actions : 3
File :

//can any one tell me where is the problem in my code ? why i was unable to retrieve filename ?



Thanks & Regards

QuestionIntercepting media stream from a running application Pin
Reena Nair21-Nov-07 19:31
Reena Nair21-Nov-07 19:31 
AnswerRe: Intercepting media stream from a running application Pin
Mark Salsbery22-Nov-07 7:16
Mark Salsbery22-Nov-07 7:16 
QuestionRegistering files with application Pin
nbugalia21-Nov-07 19:27
nbugalia21-Nov-07 19:27 
Questionstruck with OnPaint Pin
kk.tvm21-Nov-07 17:47
kk.tvm21-Nov-07 17:47 
AnswerRe: struck with OnPaint Pin
manish.patel21-Nov-07 18:15
manish.patel21-Nov-07 18:15 
AnswerRe: struck with OnPaint Pin
manish.patel21-Nov-07 18:18
manish.patel21-Nov-07 18:18 
AnswerRe: struck with OnPaint Pin
Hamid_RT21-Nov-07 18:53
Hamid_RT21-Nov-07 18:53 
GeneralRe: struck with OnPaint Pin
kk.tvm21-Nov-07 19:09
kk.tvm21-Nov-07 19:09 
GeneralRe: struck with OnPaint Pin
manish.patel21-Nov-07 19:17
manish.patel21-Nov-07 19:17 
GeneralRe: struck with OnPaint Pin
manish.patel21-Nov-07 19:20
manish.patel21-Nov-07 19:20 
GeneralRe: struck with OnPaint Pin
Hamid_RT21-Nov-07 19:24
Hamid_RT21-Nov-07 19:24 
GeneralRe: struck with OnPaint Pin
manish.patel21-Nov-07 19:38
manish.patel21-Nov-07 19:38 
GeneralRe: struck with OnPaint Pin
Hamid_RT21-Nov-07 20:19
Hamid_RT21-Nov-07 20:19 
GeneralRe: struck with OnPaint Pin
kk.tvm21-Nov-07 22:05
kk.tvm21-Nov-07 22:05 
GeneralRe: struck with OnPaint Pin
Hamid_RT22-Nov-07 0:22
Hamid_RT22-Nov-07 0:22 
GeneralRe: struck with OnPaint Pin
kk.tvm21-Nov-07 22:06
kk.tvm21-Nov-07 22:06 
GeneralRe: struck with OnPaint Pin
Hamid_RT21-Nov-07 19:23
Hamid_RT21-Nov-07 19:23 

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.