problem with messagebox's in a windows service thread
-
hi All, I have an issue for which i need some guidance/help. I've tried to be concise but please excuse me if you do not find it so. I have a windows service which interacts with ms-office (and other) applications using their API. I usually switch-off interactivity support if provided by the library/API so that no messagebox's are thrown during execution. However, occasionally due to an unforeseen situation, we get a msgbox pop-up which blocks the service thread. Given the nature of the application, its difficult to identify if the thread is blocked due to a message box or due to some processing overhead in the 3rd party application. one of the solutions i thought of is as follows - implement a monitoring thread to check if the office app does not return control. if control is not returned within a given interval, kill the app and exit the task(which is not best but feasible most of the times) however this seems more of a brute-force approach and it doesnt tell me what the issue is. In some of the cases the issue may not be reproducible immediately. Is there a more graceful approach? has anyone resolved such an issue earlier on how to identify the above situation? Thanks in advance Kalyan
-
hi All, I have an issue for which i need some guidance/help. I've tried to be concise but please excuse me if you do not find it so. I have a windows service which interacts with ms-office (and other) applications using their API. I usually switch-off interactivity support if provided by the library/API so that no messagebox's are thrown during execution. However, occasionally due to an unforeseen situation, we get a msgbox pop-up which blocks the service thread. Given the nature of the application, its difficult to identify if the thread is blocked due to a message box or due to some processing overhead in the 3rd party application. one of the solutions i thought of is as follows - implement a monitoring thread to check if the office app does not return control. if control is not returned within a given interval, kill the app and exit the task(which is not best but feasible most of the times) however this seems more of a brute-force approach and it doesnt tell me what the issue is. In some of the cases the issue may not be reproducible immediately. Is there a more graceful approach? has anyone resolved such an issue earlier on how to identify the above situation? Thanks in advance Kalyan
Yes, don't directly access the office applications themselves at all in services and this will not happen. Any time you make calls to an application you run the risk of a dialog box coming up because those apps are made to interact at the UI layer with people. Sorry, that's just the way it is. Apps are made for PEOPLE to use... not services :)
-
Yes, don't directly access the office applications themselves at all in services and this will not happen. Any time you make calls to an application you run the risk of a dialog box coming up because those apps are made to interact at the UI layer with people. Sorry, that's just the way it is. Apps are made for PEOPLE to use... not services :)