How to cancel change state by API, I use preState event and poCmd.mbCancel flag, but this flag doesnt work ?

I use C#.Net where poCmd.mbCancel flag is short type, in API documentation mbCancel is bool ?

How to use this flag or how to Cancel Change State ?

SolidworksApi macros