Check whether HMQ is already defined:
HMQ hmqCurrent = WinQueryQueueInfo( HMQ_CURRENT, &mqinfo, sizeof( MQINFO ) );