Specifically, I have a console application that im working with, but i think this topic applies to more than console apps.
The problem is i have an API that interacts with an external device on my computer. Not really relevant what the device is but the device raises events, which are it turn sent through the api where i can handle them back in code. I have a Windows Form where i declare the a new instance of the api WITHEVENTS and it handles them correctly. I want to convert this form application to a console application, eventually going to a service, but a console app for now. But when i declare an instance of the API WITHEVENTS in the console app, once processing is done in the module, the console app just exits and does not wait for events. How can i simulate a windows form in the console app enviornment to wait for events and just not exit?
The problem is i have an API that interacts with an external device on my computer. Not really relevant what the device is but the device raises events, which are it turn sent through the api where i can handle them back in code. I have a Windows Form where i declare the a new instance of the api WITHEVENTS and it handles them correctly. I want to convert this form application to a console application, eventually going to a service, but a console app for now. But when i declare an instance of the API WITHEVENTS in the console app, once processing is done in the module, the console app just exits and does not wait for events. How can i simulate a windows form in the console app enviornment to wait for events and just not exit?