If you have a profit and realize it, you would have a capital gain, which you can reinvest. If over 1 year it is long term. The capital gain is added to your other income, and if you are still in the 15% bracket, you would have no tax on the gain through 2012. Yes, your cost basis would be higher by that amount.
If dividends are reinvested they are added to the cost basis. They are always realized but can be taken in cash or reinvested.