Click here to Skip to main content
15,921,840 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: how to get mouseposition outside window Pin
Christian Graus26-Mar-07 3:08
protectorChristian Graus26-Mar-07 3:08 
AnswerRe: how to get mouseposition outside window Pin
prasad_som26-Mar-07 3:10
prasad_som26-Mar-07 3:10 
AnswerRe: how to get mouseposition outside window Pin
Emil - Gabriel26-Mar-07 3:17
Emil - Gabriel26-Mar-07 3:17 
QuestionProblem with connecting to MySQL db from my own windows service application Pin
anumadhu26-Mar-07 2:50
anumadhu26-Mar-07 2:50 
AnswerRe: Problem with connecting to MySQL db from my own windows service application Pin
JudyL_MD26-Mar-07 10:16
JudyL_MD26-Mar-07 10:16 
GeneralRe: Problem with connecting to MySQL db from my own windows service application Pin
anumadhu27-Mar-07 1:43
anumadhu27-Mar-07 1:43 
GeneralRe: Problem with connecting to MySQL db from my own windows service application Pin
JudyL_MD27-Mar-07 3:08
JudyL_MD27-Mar-07 3:08 
GeneralRe: Problem with connecting to MySQL db from my own windows service application Pin
anumadhu27-Mar-07 3:28
anumadhu27-Mar-07 3:28 
Thanks Judy!

Yeah, i have even debugged this service in following way:

1) first using the exe, i created the service :
sc create MyService binpath= D:\MyService.exe
2) Then started it from the control pannel. After it shows the status as "Started". I go to step 3.
3) Then using the Visual Studio (my development environment) + Debug + Attach Process + MyService.exe+attach.
4) And kept breakpoints in the starting of the MyServiceMain() and at the while() and also at the controlHandler function.

void ControlHandler(DWORD dwServiceCtrlEvent, DWORD dwEventType,
LPVOID lpEventData, LPVOID lpContext)
{
switch(dwServiceCtrlEvent)
{
case SERVICE_CONTROL_DEVICEEVENT:
usbObj.OnMyDeviceEvent(dwEventType,lpEventData);
break;

case SERVICE_CONTROL_STOP:
usbObj.UnRegisterEvents();
ServiceStatus.dwCurrentState = SERVICE_STOP_PENDING;//SERVICE_STOPPED;
SetServiceStatus(hStatus,&ServiceStatus);
break;

case SERVICE_CONTROL_PAUSE:
break;

case SERVICE_CONTROL_CONTINUE:
break;

case SERVICE_CONTROL_INTERROGATE:
break;

default:
break;
}
SetServiceStatus(hStatus,&ServiceStatus);
}

When i connect the USB device, then only the breakpoint is getting triggered and that too at the controlHandler()'s SERVICE_CONTROL_DEVICEEVENT. But never in or at the beginning at the MyServiceMain().

That is why, i used a WriteIntoLogFile() to get the required information regarding the order of execution of lines in my application.

Are you sure.. that my code have no errors?? Then i am bit worried..abt the cause of problem.

Thanks in advance..


Anee
GeneralRe: Problem with connecting to MySQL db from my own windows service application Pin
JudyL_MD27-Mar-07 3:42
JudyL_MD27-Mar-07 3:42 
GeneralRe: Problem with connecting to MySQL db from my own windows service application Pin
anumadhu27-Mar-07 4:13
anumadhu27-Mar-07 4:13 
GeneralRe: Problem with connecting to MySQL db from my own windows service application Pin
JudyL_MD27-Mar-07 4:19
JudyL_MD27-Mar-07 4:19 
GeneralRe: Problem with connecting to MySQL db from my own windows service application Pin
anumadhu28-Mar-07 1:50
anumadhu28-Mar-07 1:50 
GeneralRe: Problem with connecting to MySQL db from my own windows service application Pin
JudyL_MD28-Mar-07 2:14
JudyL_MD28-Mar-07 2:14 
GeneralRe: Problem with connecting to MySQL db from my own windows service application Pin
anumadhu28-Mar-07 21:06
anumadhu28-Mar-07 21:06 
QuestionRe: Problem with connecting to MySQL db from my own windows service application Pin
anumadhu28-Mar-07 23:18
anumadhu28-Mar-07 23:18 
AnswerRe: Problem with connecting to MySQL db from my own windows service application Pin
anumadhu30-Mar-07 2:12
anumadhu30-Mar-07 2:12 
Questionwhat is the role of #pragma pack(1) Pin
mo_nica88126-Mar-07 2:37
mo_nica88126-Mar-07 2:37 
AnswerRe: what is the role of #pragma pack(1) Pin
David Crow26-Mar-07 2:46
David Crow26-Mar-07 2:46 
AnswerRe: what is the role of #pragma pack(1) Pin
Cedric Moonen26-Mar-07 2:50
Cedric Moonen26-Mar-07 2:50 
AnswerRe: what is the role of #pragma pack(1) Pin
Nibu babu thomas26-Mar-07 3:16
Nibu babu thomas26-Mar-07 3:16 
GeneralRe: what is the role of #pragma pack(1) Pin
Emil - Gabriel26-Mar-07 3:30
Emil - Gabriel26-Mar-07 3:30 
GeneralRe: what is the role of #pragma pack(1) Pin
Nibu babu thomas26-Mar-07 3:32
Nibu babu thomas26-Mar-07 3:32 
GeneralRe: what is the role of #pragma pack(1) Pin
David Crow26-Mar-07 3:59
David Crow26-Mar-07 3:59 
GeneralRe: what is the role of #pragma pack(1) Pin
Emil - Gabriel26-Mar-07 4:04
Emil - Gabriel26-Mar-07 4:04 
GeneralRe: what is the role of #pragma pack(1) Pin
David Crow26-Mar-07 4:17
David Crow26-Mar-07 4:17 

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.