converting tag number to int
- by Ehtesham Sajed
i m using Visual C++2008. i've assigned tag value=2 of all buttons from button property(using drag n drop). now i want to make some math calculation with tag value. need to change it in int. what is the default data type tag? i used this code,
//code sample
if(((int)this-button1-Tag)((int)this-button2-Tag)((int)this-button3-Tag)==50)
{
........
//i.e, if tag value of button1*tag value of button2*tag value of button 3==50 then...
........
}
generated following run time error on a messegebox
An unhandled exception of type 'System.InvalidCastException' occurred in learncpp1.exe
Additional information: Specified cast is not valid.