In medium saucepan, combine sugar, cornstarch, and salt. Stir in milk, blending until smooth.
Cook over medium heat until smooth. Cook over medium heat until mixture boils and thickens, stirring constantly. Boil for 2 minutes. Remove from heat.
Blend a small amount of hot mixture into egg yolks (reserve whites). Return to saucepan, blending well. Cook until mixture just begins to bubble, stirring constantly. Remove from heat; stir in margarine and vanilla.
Pour into pie shell. Refrigerate for 3 hours. Serve with whipped cream.