Click to See Complete Forum and Search --> : I need help w/ my program!


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;
}
};
}

cilu
October 12th, 2009, 01:27 PM
[ redirected ]

glourung
October 12th, 2009, 09:55 PM
I believe that you can just remove Debug folder and rebuild. Or Try to check access to Debug folder - possibly you have no access there.
Also I am not sure that name 'Planets (Version 1).exe' is supported by compiler of file system or anything. I think that just renaming project to some think more simple like 'Planets_v1.exe' with no spaces and brackets will fix your problem.

nick.boon
October 12th, 2009, 10:15 PM
Wow thank you very much I deleted the debug folder and sure enough it worked!