Sign in to follow this  

InterComm crash

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=""]here[/url]

To call it I use

[code]int _stdcall MessageReceived(DataMode id, PCHAR data)
switch (id)
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;

Share this post

Link to post
Share on other sites

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