|
-
October 3rd, 2008, 10:25 PM
#1
[RESOLVED] Help with my app
I was working on an app that downloads and installs addons for an online game.
I absolutely can not figure out what is wrong with it, i try debuging and it doesn't even step into the next thread.
If anyone is willing to look over it i will attach the source.
The amount of code in it is far too much to post.
Advice and suggestions welcome.
Thank you.
-
October 4th, 2008, 02:30 AM
#2
Re: Help with my app
please post the part of your code that you think it is faulty and also error and warnings you recieved.
-
October 4th, 2008, 07:27 AM
#3
Re: Help with my app
You need to start the thread.
Code:
private void btnInstall_Click( object sender, EventArgs e )
{
if( Locations.Addons == null )
{
GMAI.WriteLine( "You do not have Garrys Mod installed!" );
}
else
{
EnableItems( false );
listFailed.Items.Clear( );
MainThread = new Thread( new ThreadStart( ExecutionPoint ) );
MainThread.Start( );
}
}
I'd recommend following the C# naming conventions as well.
1) Namely private fields are camelCase (and preferably are prefixed with an underscore).
2) Public static fields and Properties are PascalCase.
Using this naming, MainThread (a private field) would become _mainThread and GMAI.download (a public static field) would become GMAI.Download.
-
October 4th, 2008, 07:33 AM
#4
Re: Help with my app
Lastly, the Locations code is very fragile.
For example, this class won't initialize if \\Gmod Addons\\ isn't a sub-folder of 'My Documents'.
I know you expect folks to have Steam or Garry's mods installed, but consider failing more gracefully if they don't.
The following doesn't allow for gracefull failing (if the Gmod... folder isn't present):
Code:
public static readonly string Save = Environment.GetFolderPath( Environment.SpecialFolder.MyDocuments ) + "\\Gmod Addons\\";
One strategy is to check for these folders and to display a message box if a needed folder isn't present.
-
October 4th, 2008, 09:38 AM
#5
Re: Help with my app
 Originally Posted by Arjay
Lastly, the Locations code is very fragile.
For example, this class won't initialize if \\Gmod Addons\\ isn't a sub-folder of 'My Documents'.
I know you expect folks to have Steam or Garry's mods installed, but consider failing more gracefully if they don't.
The following doesn't allow for gracefull failing (if the Gmod... folder isn't present):
Code:
public static readonly string Save = Environment.GetFolderPath( Environment.SpecialFolder.MyDocuments ) + "\\Gmod Addons\\";
One strategy is to check for these folders and to display a message box if a needed folder isn't present.
Thanks again Arjay, it was late and now i feel REALLY stupid for not adding MainThread.Start();
And thanks for the info about the fragile class code. Ill fix them.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|