nick.boon
October 11th, 2009, 09:39 PM
I'm trying to make this program for Computer Science class but it gives me this stupid bug:
Error 1 general error c101008d: Failed to write the updated manifest to the resource of file "..\Debug\Planets (Version 1).exe". Access is denied. mt.exe
What does this mean!?!?
This is my code:
#pragma endregion
// Static constants
static const int xcenter = 200;
static const int ycenter = 250;
static const int smajor = 150;
static const int sminor = 50;
// Instance Variables
double angle_degrees;
// Drawing objects
Drawing::Graphics^ g;
Drawing::Brush^ yellowBrush; // Yellow for sun
Drawing::Brush^ cyanBrush; // Cyan for planet
private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {
// Construct drawing objects
g = pictureBox1->CreateGraphics();
yellowBrush = gcnew Drawing::SolidBrush(Color::Yellow);
cyanBrush = gcnew Drawing::SolidBrush(Color::Cyan)
; }
private: System::Void btnStart_Click(System::Object^ sender, System::EventArgs^ e) {
angle_degrees = 0;
timer1->Enabled = true;
}
private: System::Void btnStop_Click(System::Object^ sender, System::EventArgs^ e) {
timer1->Enabled = false;
}
private: System::Void timer1_Tick(System::Object^ sender, System::EventArgs^ e) {
// Declare local variables
int x, y; // x,y coordinates of the planet
double angle_radians; // angle measurement in radians
// Refresh the picture box to remove old images
pictureBox1->Refresh();
// Draw the sun (use a rectangle as a guide)
System::Drawing::Rectangle
sunRect(xcenter,ycenter,16,16);
g->FillEllipse(yellowBrush,sunRect); // draw sun
// Draw the planet
if (angle_degrees >= 360) angle_degrees = 0;
angle_radians = angle_degrees * Math::PI / 180;
// Calculate new x and y
x = xcenter + smajor * Math::Cos(angle_radians);
y = ycenter - sminor * Math::Sin(angle_radians);
// Draw planet
System::Drawing::Rectangle planetRect(x,y,10,10);
g->FillEllipse(cyanBrush,planetRect);
//Increase angle by 5 degrees
angle_degrees += 5;
}
};
}
Error 1 general error c101008d: Failed to write the updated manifest to the resource of file "..\Debug\Planets (Version 1).exe". Access is denied. mt.exe
What does this mean!?!?
This is my code:
#pragma endregion
// Static constants
static const int xcenter = 200;
static const int ycenter = 250;
static const int smajor = 150;
static const int sminor = 50;
// Instance Variables
double angle_degrees;
// Drawing objects
Drawing::Graphics^ g;
Drawing::Brush^ yellowBrush; // Yellow for sun
Drawing::Brush^ cyanBrush; // Cyan for planet
private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {
// Construct drawing objects
g = pictureBox1->CreateGraphics();
yellowBrush = gcnew Drawing::SolidBrush(Color::Yellow);
cyanBrush = gcnew Drawing::SolidBrush(Color::Cyan)
; }
private: System::Void btnStart_Click(System::Object^ sender, System::EventArgs^ e) {
angle_degrees = 0;
timer1->Enabled = true;
}
private: System::Void btnStop_Click(System::Object^ sender, System::EventArgs^ e) {
timer1->Enabled = false;
}
private: System::Void timer1_Tick(System::Object^ sender, System::EventArgs^ e) {
// Declare local variables
int x, y; // x,y coordinates of the planet
double angle_radians; // angle measurement in radians
// Refresh the picture box to remove old images
pictureBox1->Refresh();
// Draw the sun (use a rectangle as a guide)
System::Drawing::Rectangle
sunRect(xcenter,ycenter,16,16);
g->FillEllipse(yellowBrush,sunRect); // draw sun
// Draw the planet
if (angle_degrees >= 360) angle_degrees = 0;
angle_radians = angle_degrees * Math::PI / 180;
// Calculate new x and y
x = xcenter + smajor * Math::Cos(angle_radians);
y = ycenter - sminor * Math::Sin(angle_radians);
// Draw planet
System::Drawing::Rectangle planetRect(x,y,10,10);
g->FillEllipse(cyanBrush,planetRect);
//Increase angle by 5 degrees
angle_degrees += 5;
}
};
}