n4gix
Resource contributor
- Messages
- 11,674
- Country

As those who've ever "converted" an EasyGauge project to a multi-gauge knows,
one of the problems I (and everyone else) have encountered when trying to use
the GaugeStopSound function in MSVC++ is that -well- the darn sound won't stop!
I spent most of today trying to find out why the function works when compiled
with MinGW (a la EasyGauge) but will NOT work when the same gauge is compiled
by any other means (Borland, MSVC++ .NET 2003, et cetera)...
While I still don't know why an LPTSTR "string" isn't being passed by the function,
but after several hours of study and frustration, it finally occured to me to try
passing an integer instead... Well I'll be darned... it works!
First, I changed the "Sound declarations" as follows:
Then, I substituted an integer value in the function call like this:
Granted, the integer 4 isn't nearly as descriptive as -say - "firetest"
but at least the bloody thing works now!
one of the problems I (and everyone else) have encountered when trying to use
the GaugeStopSound function in MSVC++ is that -well- the darn sound won't stop!
I spent most of today trying to find out why the function works when compiled
with MinGW (a la EasyGauge) but will NOT work when the same gauge is compiled
by any other means (Borland, MSVC++ .NET 2003, et cetera)...
While I still don't know why an LPTSTR "string" isn't being passed by the function,
but after several hours of study and frustration, it finally occured to me to try
passing an integer instead... Well I'll be darned... it works!
First, I changed the "Sound declarations" as follows:
Code:
// Sound declarations
typedef VOID (*TGaugePlaySound)(LPTSTR,int,int); // 2nd param changed from LPTSTR to int
typedef VOID (*TGaugeStopSound)(int); // param changed from LPTSTR to int
TGaugePlaySound GaugePlaySound;
TGaugeStopSound GaugeStopSound;
HMODULE MGaugeSound;
Code:
if ( *rotarytest == 1 )
{ (GaugePlaySound)("sound\\esdg\\fire.wav",4,1) ; }
else { (GaugeStopSound)(4); }
but at least the bloody thing works now!
Last edited:

