views:

48

answers:

2

I have two machines: my dev machine has Windows Server 2008 R2 on it, along with Visual Studio 2008. I'm compiling my applciation on there. My other machine is the target machine and it runs Windows XP.

The problem is that I have a MessageBox call that works on the dev machine but not on the target machine.

I've commented out everything in WinMain so that it is now only this:

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)
{
    MessageBox(NULL, "Your application is already running!", "Application Notification", MB_OK|MB_ICONINFORMATION);
    return 0;
}

On the dev machine the message box pops up fine (with no sound), on the XP machine everything else is fine, except that instead of the popup box I just hear the "ba-ding" popup sound.

What small setting in the bowels of MSVC++ do I need to change to get this to work on XP?

The character set I'm using is "Not Set". I'm not sure if that does anything, but I tried changing it to multibyte with no dice.

A: 

This is about as basic as it can get and should work on any windows system. You could check the return value of MessageBox, if it is 0, call GetLastError()

Anders
+1  A: 

I've seen the beep-instead-of-a-window thing when there is a misconfigured manifest resource/external appname.exe.manifest so if your using one, try disabling it.

Alex K.