worries sick... overweight and pregnant...

OK.. I know it's not safe and it scares me so bad. I just found out today I'm pregnant and im 5ft 2in and 245lbs.... even worse my heart is straining already bc my weight and my Dr was already worried about that... any advice on how to lose weight while pregnant? is it safe? can I start exercising? I just want to have a healthy pregnancy and baby and I'm scared.... I'm already planning to lose all this extra weight after this baby but can I start while I'm pregnant? has anyone lost weight while pregnant?