We ca not use the Shannon formula for a given modulation. This formula is a theoretical limit, which can be achieved only when the input signal is drawn from Gaussian distribution, which obviously not practical, since Gaussian distribution is a continuous function.
The formula in the link says that the number of bits must be less than or equal the capacity, and not equal as you indicated. There is a difference. The capacity by definition is the maximum bit rate that can be supported with negligible bit error rate. So, it is natural to chose m (the constellation size) less than the maximum bit rate, since otherwise, the error will not be negligible.
In my opinion, you can not include the modulation in the formula. I do not think you can include the coding effect neither, but you can calculate the capacity at certain SNR, which may correspond to the coded bit SNR. However, for sure you can include the Tx power, by taking the effect of path loss between the transmitter and the receiver.