locked
how log error message without dialogbox in windows ce 6.0 RRS feed

  • Question

  • how can i log error message without any error dialogbox in windows ce 6.0 in my application

    i wrote an application with mfc for windows ce 6.0

    Saturday, October 1, 2016 10:55 AM

Answers


  • Hi  md_zi2013,

    >>how can i log error message without any error dialogbox in windows ce 6.0 in my application

    You can create a text file to log error messages in your application.

       private void saveFile(string filepath, string errormessage)
            {
                // If the File does not exist, create it!
                if (!File.Exists(filepath)) // may have to specify path here!
                {
                    // may have to specify path here!
                    File.Create(filepath).Close();
                }
                // may have to specify path here!
                StreamWriter swFile =
                             new StreamWriter(
                                new FileStream(filepath,
                                               FileMode.Append),
                                Encoding.ASCII);
                swFile.Write(errormessage);
                swFile.Close();
            }

    Also, you can refer the following links:

    about How to Configure Logging for Windows Mobile and Windows CE Devices.

    Best Regards,

    Yohann Lu

    Sunday, October 2, 2016 2:27 AM