Jump to content
  • Advertisement
Sign in to follow this  
Headkaze

InterComm crash

This topic is 2191 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 here

To call it I use

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;
}
...
}

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!