Sign in to follow this  

InterComm crash

This topic is 1973 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've written a class that uses a mutex to allow an application to detect if it's already running and if so send the command line arguments to the other instance and exit. The problem is it seems to be causing a random crash at startup. I cannot seem to get it to crash with the debugger attached so I'm not even sure if it's this class causing it. I'm really at a loss here so I'm hoping someone might spot an obvious bug.

I've posted the entire CInterComm class on pastebin [url="http://pastebin.com/e9xrhTu4"]here[/url]

To call it I use

[code]int _stdcall MessageReceived(DataMode id, PCHAR data)
{
switch (id)
{
case MODE_CMDLINE:
ProcessCmdLine(data);
break;
}
return 1;
}

int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
m_hInstance = hInstance;

m_InterComm.Initialize(hInstance, MessageReceived);

if (m_InterComm.CommMode() == MODE_CLIENT)
{
m_InterComm.SendMessage(MODE_CMDLINE, lpCmdLine);
return 1;
}
...
}[/code]

Share this post


Link to post
Share on other sites

This topic is 1973 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this