Click here to Skip to main content
15,922,015 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Help with vector/array Pin
Maximilien26-Mar-07 3:37
Maximilien26-Mar-07 3:37 
AnswerRe: Help with vector/array Pin
David Crow26-Mar-07 4:05
David Crow26-Mar-07 4:05 
AnswerRe: Help with vector/array Pin
Stephen Hewitt26-Mar-07 13:29
Stephen Hewitt26-Mar-07 13:29 
Questionhow to get mouseposition outside window Pin
Goggelmoggel26-Mar-07 3:04
Goggelmoggel26-Mar-07 3:04 
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 
Hello,

I have created a windows service application in windows XP and VC++.Net.
In this windows service application, i am connecting to MySQL database on the same computer. My application is to get the USB plug-n-plays. I am opening the MySQL db not in the ServiceMain() of the service, rather, since i have to every time check for the database connection, so in case of everyrequirement.. i am opening the database and throwing the exception, on db connection failure.

I can see that, everytime the statement :

usbDB.OpenEx(szConnectString_USB,CDatabase::noOdbcDialog); is throwing the exception.

in the catch() block i reported the error too, but it is not displaying the error report.

After that, i restarted the system and then i see that, when i follow the debugger, the breakpoint at the usbDB.OpenEx(..) is not getting triggered.

myServiceMain(int arg, char *argv)
{
hStatus=RegisterServiceCtrlHandler(szServiceName, handlerFunc);
SetServiceStatus(hStatus, &ServiceStatus);
initService();
....
....
RegisterDeviceNotification(hStatus),&NotificationFiler,DEVICE_NOTIFY_SERVICE_HANDLE);
....
....
while(ServiceStatus.dwCurrentStatus=SERVICE_RUNNING)
{
/*do my task*/
....
....
}
ServiceStatus.dwCurrentStatus=STOPPED;
SetServiceStatus(hStatus,&ServiceStatus);
}

InitService()
{
/* intialisation code for my Service*/
}

I think, in the MyServiceMain(..) the code after the RegisterServiceCtrlHandlerEx(...) is not getting executed. So, the breakpoint kept inside the InitService() is not getting called. Even the breakpoint inside the MyServiceMain() is also not getting called. To trigger the breakpoints in the MyServiceMain() callback function, when i am stopping and restarting or restarting the service from the control panel... the service is not getting stopped ..it is only showing that... "stopping".

I have checked the dsn name, user id and password also... but i don know why, it is not getting connected to my windows service application.

Thank you
Anee



Anee
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 
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 

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.