ORIGINAL QUESTION
Our application uses CSocket, which requires the message pump to work, for it to work. It is currently not practical to switch to another socket implementation, although at some point we want to finish.
The application is in Visual C ++ (NOT managed).
We are currently starting the C ++ DLL using the C # .NET launcher, which starts the thread using Application.Run to start the message pump, and then uses DllImport to start the start method in our DLL.
There are many problems associated with this, the most relevant of which is that if the DLL crashes for any reason, we do not get the dump file!
As a result of this, we move on to the C ++ launcher, and while we are fine with the service aspect, we are a bit unhappy with how to get the message pump to go.
I had a google review and some questions here, but part of my problem is the lack of basic C ++ knowledge, so apologize if this is a cheating question, if someone can point me in the right direction, which would be highly appreciated.
Thanks so much in advance Matt Pedldsden
ADDITIONAL INFORMATION
The current C # service we are trying to replace is essentially this:
public void PumpThread() { DLLStart(); Application.Run(); } protected override void OnStart(string[] args) { try { Thread pumpThread = new Thread(new ThreadStart(PumpThread)); pumpThread.IsBackground = true; pumpThread.Start(); } catch (DllNotFoundException dnfe) { } catch (Exception e) { } } protected override void OnStop() { try { DLLStop(); } catch (DllNotFoundException dnfe) { } catch (Exception e) { } }
In fact, we are just trying to replace the above C # .NET Windows Service with the C ++ equivalent, so that our code works completely in an unmanaged world, and does not unnecessarily confuse this with 5 lines of managed code.
DLLStart () and DLLStop () are two functions that are imported from our C ++ unmanaged DLL, which actually starts and stops the system.
I'm not quite sure what Visual C ++ project it should be in order to be able to do anything with a pump, to be honest.
We hope that this additional data will be useful.