I'm glad you finally got it working, Michel!
~~Bonnie
>Well, what do we know! lol All this invisible Console application mode and disappearing immediately was due to a change which wasn't saved at the project property level. So, I changed back to Console application. Then, it started to work.
>
>It took me a while to find that. Because, the last time I checked, it was really a Console application. Then, hours later, I checked back, and it was reversed to a Windows Service. I do not know if this could have been related to the manual adjustment I had to do earlier on on the application and resource files.
>
>IAC, I have it running now. I have a Windows Service, and if needed, I can click on the EXE as is and benefit from an interface.
>
>BTW, I have found a reference which was very similar to yours:
>
>
http://www.tomdupont.net/2013/02/running-windows-service-as-console-app.html>
>It is when I checked that page that I thought the fix is not there. That code is ok as is. It must be a config setting. And, it was.
>
>Now, the fun part begins. What used to be a robot application, where all the status message were shown on the desktop, is now a WS with the capability to redirect those messages on the Console instead, if I wish to, as I adjusted all the calls to the oForm.Status.Text="Something" to call a method. Thus, in that method I can verify in which mode I am and broadcast that message on a Console. I do have a database log at various levels. But, as you know, sometimes, we may need to enter in such mode and that design will suit the requirement perfectly.
>
>Thanks a lot