ORIGINAL QUESTION
Our application uses CSocket which requires the message pump to be running in order for it to work. Currently it's not practical to change to another socket implementation, though that is where we'd like to end up at some point.
The application is in Visual C++ (NOT managed).
We currently launch the C++ DLL by using a C#.NET service launcher that kicks off a thread with an Application.Run to get the message pump going, and then uses DllImport to fire off the start method in our DLL.
There are numerous problems with this, the most pressing of which is that if the DLL crashes for any reason we don't get a dump file!
As a result of this, we're switching to a C++ service launcher, and while we're fine with the service aspect of it we're a bit stumped on how to get the message pump going.
I had a look around google and some questions on here but part of my problem is a lack of basic C++ knowledge so apologies if this is a dupe question, if someone can point me in the right direction that would be much appreciated.
Many thanks in advance Matt Peddlesden
MORE INFORMATION
The current C# service that we are trying to replace does 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)
{
}
}
Essentially we're simply trying to replace the above C# .NET Windows Service with a C++ equivalent so that our code is running entirely in the unmanaged world rather than unnecessarily confusing this with 5 lines of managed code.
DLLStart() and DLLStop() are two functions that are imported from our C+ Unmanaged DLL that actually start and stop the system.
I'm not entirely sure what kind of Visual C++ project this would need to be in order to be able to do anything with the pump either to be honest.
Hope this additional data is useful.