Link to home
Start Free TrialLog in
Avatar of hongjun
hongjunFlag for Singapore

asked on

MACRO Problem

I have defined a macro and have encountered a problem using it. Below is the macro I have defined.

#define BULLET PlaySound("bullet.wav",NULL,SND_FILENAME|SND_ASYNC)

I then try to use it and is successful.

void main()
{
...
    BULLET; // run the macro
...
}

The above works and I heard the sound of one bullet.
However, when I tried to run the macro twice consecutively, it is unsuccessful.

void main()
{
...
    BULLET; // run macro
    BULLET; // another time
...
}

I expect to hear two bullets sound but I only hear one bullet sound.

Why?

hongjun
ASKER CERTIFIED SOLUTION
Avatar of nietod
nietod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of hongjun

ASKER

Well done!!!

hongjun