Click here to Skip to main content
15,909,896 members
Home / Discussions / C#
   

C#

 
AnswerRe: Image to bitmap conversion error...again! Pin
stancrm27-Apr-09 21:24
stancrm27-Apr-09 21:24 
GeneralRe: Image to bitmap conversion error...again! Pin
Christian Graus27-Apr-09 22:08
protectorChristian Graus27-Apr-09 22:08 
AnswerRe: Image to bitmap conversion error...again! Pin
Christian Graus27-Apr-09 22:09
protectorChristian Graus27-Apr-09 22:09 
AnswerRe: Image to bitmap conversion error...again! Pin
Henry Minute28-Apr-09 0:56
Henry Minute28-Apr-09 0:56 
QuestionVersion of Confog File Pin
Chapooki27-Apr-09 20:45
Chapooki27-Apr-09 20:45 
AnswerRe: Version of Confog File Pin
12Code27-Apr-09 20:57
12Code27-Apr-09 20:57 
GeneralRe: Version of Confog File Pin
Chapooki27-Apr-09 21:00
Chapooki27-Apr-09 21:00 
QuestionNot all path return a value? Pin
Megidolaon27-Apr-09 20:43
Megidolaon27-Apr-09 20:43 
I get this error, even though I don't know why.

The code throwing this error is this:
bool ReadIni()
        {
            try
            {
                string error = "";
                try
                {
                    //read ini from file
                }
                catch (Exception ex)
                {
                    //show error message, but continue because the user is promtped to input the 
                    //values manually and file will be created.
                }

                if (ini != null) //ini is a string array filled with the content of the ini file
                {
                    //parse values from ini and store sucess in an array
                    //write error message to string error
                }
                else
                {
                    for (int i = 0; i < 5; i++)
                    {
                        conversion[i] = false; //set all bools in the array to false
                    }
                }
                //this part seems throw the error
                if (error != "" || ini == null)
                {
                    //show error message
                    MessageBox.Show(error + "\r\nPlease input the missing values", "Input missing 
                    values", MessageBoxButtons.OK, MessageBoxIcon.Error);

                    //initialize F_Manual_Input with array       //bool       int     string 
                    F_Manual_Input forminput = new F_Manual_Input(conversion, values, inipath);
                    this.Show(); //show this form as first as "background" starting up
                    forminput.ShowDialog();
                    //set map and tile size with manually input values 
                    this.mapsize = new Size(forminput.MapWidth, forminput.MapHeight);
                    this.tilewidth = forminput.TileWidth;
                    this.tileheight = forminput.TileHeight;

                    return false; //values had to be manually input
                }
                else
                {
                    //set map/tile size and image width with values from file
                    this.mapsize = new Size(sizeX, sizeY);
                    this.tilewidth = tileX;
                    this.tileheight = tileY;
                    this.imagewidth = sourceX;

                    return true; //input was read from file
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("An error occurred while reading the ini file:\r\n" + ex.Message,
                    "System Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
The final if/else block causes the error.
Even if I out comment it and write return true; instead, I get the same error.
But I don't know why I get it in the first place.
All the code before the final if/else block will just be executed one after another normally and there are no unresolved if blocks or anything, no way the method could stop there.
And the final if/else block catching 2 different cases, but also returns avalue in all other cases.

I'd really appreciate if you could tell me what went wrong.
AnswerRe: Not all path return a value? Pin
12Code27-Apr-09 20:48
12Code27-Apr-09 20:48 
GeneralRe: Not all path return a value? Pin
Megidolaon27-Apr-09 21:52
Megidolaon27-Apr-09 21:52 
AnswerRe: Not all path return a value? Pin
Murugesan G27-Apr-09 20:48
Murugesan G27-Apr-09 20:48 
GeneralRe: Not all path return a value? Pin
Megidolaon27-Apr-09 21:54
Megidolaon27-Apr-09 21:54 
AnswerRe: Not all path return a value? Pin
Spunky Coder27-Apr-09 22:27
Spunky Coder27-Apr-09 22:27 
GeneralRe: Not all path return a value? Pin
Megidolaon28-Apr-09 20:45
Megidolaon28-Apr-09 20:45 
QuestionI need some information on enabling-disabling a software (registration-activation) Pin
Roshanakak27-Apr-09 20:38
Roshanakak27-Apr-09 20:38 
AnswerRe: I need some information on enabling-disabling a software (registration-activation) Pin
Nagy Vilmos27-Apr-09 22:01
professionalNagy Vilmos27-Apr-09 22:01 
GeneralRe: I need some information on enabling-disabling a software (registration-activation) Pin
Roshanakak28-Apr-09 0:03
Roshanakak28-Apr-09 0:03 
GeneralRe: I need some information on enabling-disabling a software (registration-activation) Pin
Nagy Vilmos28-Apr-09 1:04
professionalNagy Vilmos28-Apr-09 1:04 
Questionhow to write excel data in binary Pin
kaushik_dass27-Apr-09 20:03
kaushik_dass27-Apr-09 20:03 
AnswerRe: how to write excel data in binary Pin
Murugesan G27-Apr-09 20:54
Murugesan G27-Apr-09 20:54 
QuestionCopying current program to a location..... help please! Pin
Rajdeep.NET is BACK27-Apr-09 19:28
Rajdeep.NET is BACK27-Apr-09 19:28 
AnswerRe: Copying current program to a location..... help please! Pin
12Code27-Apr-09 19:36
12Code27-Apr-09 19:36 
GeneralRe: Copying current program to a location..... help please! Pin
Rajdeep.NET is BACK27-Apr-09 20:12
Rajdeep.NET is BACK27-Apr-09 20:12 
GeneralRe: Copying current program to a location..... help please! Pin
12Code27-Apr-09 20:20
12Code27-Apr-09 20:20 
AnswerRe: Copying current program to a location..... help please! Pin
musefan27-Apr-09 22:02
musefan27-Apr-09 22:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.