your question is incorrect; A) gambling (in it's broadest sense) is based 100% on chance, no skill required:
A mentally retarded person can gamble; all they have to do is pick what to bet on.
If you are just buying stock in any company you think is doing good and you assume they'll continue on that trend without reading up on them, then that is identical to gambling and in this case alone: You are correct investing is IN THIS CASE very similar to gambling, but not exactly the same, because a shareholder can always lay claim on assets to the value of his share in the company. That's a fundamental difference.
B) You always have knowledge (to some extent) of the outcome of one and never any knowledge of the outcome of the other:
The gambler has no hint or clue what the outcome will be, the only knowledge he does have is odds, and when he puts his money into the pot, he receives nothing in return
C) One is a trade, the other is not
-When you invest in a company, you become an owner of that company and you own a percentage of that companies equipment/assets/debt/etc.
-When you bet on something, the only thing you get in return is hope.
I'm sure everyone can expand on this, but this is not something you need to go to the Qur'aan or Sunnah for, pure logic, so no references.