Click here to Skip to main content
15,919,358 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionthat is occuring while executingerror Pin
kir_MFC31-Mar-09 3:40
kir_MFC31-Mar-09 3:40 
QuestionRe: that is occuring while executingerror Pin
David Crow31-Mar-09 3:48
David Crow31-Mar-09 3:48 
QuestionCreate Integrated Development Environment (IDE) like VC++ in VC++ 6.0 Pin
kingmax_00731-Mar-09 2:59
kingmax_00731-Mar-09 2:59 
AnswerRe: Create Integrated Development Environment (IDE) like VC++ in VC++ 6.0 Pin
led mike31-Mar-09 5:28
led mike31-Mar-09 5:28 
GeneralRe: Create Integrated Development Environment (IDE) like VC++ in VC++ 6.0 Pin
ThatsAlok31-Mar-09 20:19
ThatsAlok31-Mar-09 20:19 
GeneralRe: Create Integrated Development Environment (IDE) like VC++ in VC++ 6.0 Pin
kingmax_0075-Apr-09 4:18
kingmax_0075-Apr-09 4:18 
AnswerRe: Create Integrated Development Environment (IDE) like VC++ in VC++ 6.0 Pin
ThatsAlok31-Mar-09 20:16
ThatsAlok31-Mar-09 20:16 
QuestionError compiling call to Windows API function. Pin
AlainDev2231-Mar-09 2:56
AlainDev2231-Mar-09 2:56 
Hi
I am working on a CPP that created services.

It complains about the last value in the SERVICE_FAILURE_ACTIONS struct.

According to the Microsoft it is defined as follows:


lpsaActions

A pointer to an array of SC_ACTION structures.


--------------------
When compiling code that calls the function that sets the failure acitons of a server I get the following output.



---------------------------------------------------------------


SC_ACTION *action_array[1];


SC_ACTION* action_str = new SC_ACTION();
action_str->Type = SC_ACTION_RESTART;
action_str->Delay =6000;

action_array[0] = action_str;



SERVICE_FAILURE_ACTIONS actions_struct;
actions_struct.dwResetPeriod = 86400;
actions_struct.lpRebootMsg = NULL;
actions_struct.lpCommand = NULL;
actions_struct.cActions = 1;
LINE(588)---> actions_struct.lpsaActions = action_array;

int result2 = ChangeServiceConfig2W(
service,
SERVICE_CONFIG_FAILURE_ACTIONS,
&actions_struct);

------------------------
OUTPUT

#
Building post_service.dll ...
#
cl.exe @C:\xxxx\nma05692.
#
WindowsService.cpp
#
c:\xxxxxxx\windowsservice.cpp(588) :
#
error C2440: '=' : cannot convert from 'struct _SC_ACTION *[1]' to 'struct _SC_A
#
TION *'
#
Types pointed to are unrelated; conversion requires reinterpret_cast, C
#
style cast or function-style cast
#
NMAKE : U1077: 'cl.exe' : return code '0x2'
#
Stop.
---------------------------------------------


Is there something obvious that I am doing wrong here? My CPP is a little rusty. Frown | :( Would appreciate any help I can get
AnswerRe: Error compiling call to Windows API function. Pin
Stuart Dootson31-Mar-09 3:11
professionalStuart Dootson31-Mar-09 3:11 
AnswerRe: Error compiling call to Windows API function. Pin
David Crow31-Mar-09 3:17
David Crow31-Mar-09 3:17 
Questionerror that is occuring while executing the project Pin
kir_MFC31-Mar-09 2:54
kir_MFC31-Mar-09 2:54 
AnswerRe: error that is occuring while executing the project Pin
Chandrasekharan P31-Mar-09 3:12
Chandrasekharan P31-Mar-09 3:12 
GeneralRe: error that is occuring while executing the project Pin
kir_MFC31-Mar-09 3:38
kir_MFC31-Mar-09 3:38 
QuestionRe: error that is occuring while executing the project Pin
David Crow31-Mar-09 3:53
David Crow31-Mar-09 3:53 
QuestionHelp with Mouse Button and counter Pin
Member 23626231-Mar-09 1:33
Member 23626231-Mar-09 1:33 
AnswerRe: Help with Mouse Button and counter Pin
Rajesh R Subramanian31-Mar-09 1:37
professionalRajesh R Subramanian31-Mar-09 1:37 
AnswerRe: Help with Mouse Button and counter Pin
Cedric Moonen31-Mar-09 1:40
Cedric Moonen31-Mar-09 1:40 
GeneralRe: Help with Mouse Button and counter Pin
Rajesh R Subramanian31-Mar-09 2:31
professionalRajesh R Subramanian31-Mar-09 2:31 
Joke[OT] Re: Help with Mouse Button and counter Pin
David Crow31-Mar-09 3:26
David Crow31-Mar-09 3:26 
GeneralRe: Help with Mouse Button and counter Pin
Luc Pattyn31-Mar-09 5:09
sitebuilderLuc Pattyn31-Mar-09 5:09 
GeneralRe: Help with Mouse Button and counter Pin
Rajesh R Subramanian31-Mar-09 20:56
professionalRajesh R Subramanian31-Mar-09 20:56 
GeneralRe: Help with Mouse Button and counter Pin
Member 23626231-Mar-09 4:06
Member 23626231-Mar-09 4:06 
GeneralRe: Help with Mouse Button and counter Pin
Luc Pattyn31-Mar-09 5:12
sitebuilderLuc Pattyn31-Mar-09 5:12 
AnswerRe: Help with Mouse Button and counter Pin
Iain Clarke, Warrior Programmer31-Mar-09 1:46
Iain Clarke, Warrior Programmer31-Mar-09 1:46 
GeneralRe: Help with Mouse Button and counter Pin
Member 2362621-Apr-09 3:06
Member 2362621-Apr-09 3:06 

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.