error log ????
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10

Thread: error log ????

  1. #1
    Join Date
    Oct 2003
    Location
    Chula Vista, CA
    Posts
    51

    error log ????

    Hi All,

    I am running an Visual C++ application on a laptop that does not have Visual Studio installed. I (obviously) created the application on a different machine. This application is a simple Win32 application with no interactive windows. It merely runs (after double clicking on it) and waits for information to come across a serial port. It has some threading.

    The error I am receiving is "Application-so-and-so has generated errors and will be closed by Windows. You will need to restart the program. An error log is being created".

    I cannot find the error log anywhere on my system. I dont even know what the name of the log file would be. I couldnt find anything on MSDN. Help??? I am on a deadline and am pulling my hair out.

    thanks,
    Bill

  2. #2
    Join Date
    Apr 1999
    Posts
    27,427
    I believe the error log is the Dr. Watson log. Go to Start/Run and type in DRWTSN32.

    Also, maybe you should install Visual Studio (or at least VC++) on the laptop. If you have the machine available, this could require an extensive debugging session to find the error.

    Or if you have an Internet connection from the machine to the laptop, debug remotely from the machine that has VC++ to the laptop.

    Also, the cause is usually bad programming on your part, and/or the laptop has different versions of system DLL's or program related DLL's (such as the MFC DLL's) that your app relies on.

    Regards,

    Paul McKenzie

  3. #3
    Join Date
    Oct 2003
    Location
    Chula Vista, CA
    Posts
    51
    I had no idea that Dr. Watson utility even existed!!!

    Trying to read the text in the drwtsn32.txt file is a bit confusing too.

    Next stupid question: how would I run remotely? I have a network connection (local LAN at my place of work). Is there some instruction as to how to run the debugger remotely? The only thing I have uncovered is instruction on using the kernal debugger.

    I cannot install VC++ on this machine (or shouldnt). The application will be used on various machines that do not have VC++, and running this app on machines that DO have VC++ produce no such errors.

    If the laptop has different DLL's, how can I package up the correct DLL's (how do I know which ones)?

    Your help is really really appreciated.

    Bill

  4. #4
    Join Date
    Apr 1999
    Posts
    27,427
    That's a lot of questions, I'll try to tackle the remote debugging question.

    To debug remotely is a multi-step process and is hard for me to explain everything in one message. However, the first of these steps is to create a release version of your application that contains debug information (you should do this anyway -- it will probably make your log file easier to understand).

    To do this, go to the Project Settings of your application and choose the Release version setup. Go to the C/C++ tab and make sure that the "General" category is selected. Then instead of "None" for Debug Info, choose "Program Database". I would also disable the optimizations. Next you go to the Link tab and select "Generate Debug Info". Rebuild your application. You have a release build with debug info. Copy this new version onto the laptop.

    Next, the laptop must have the following files. If not, copy them from your development PC to the laptop:

    MSVCP60.DLL
    PSAPI.DLL

    (These files are found in the \Program Files\Microsoft Visual Studio\Common\MsDev98\Bin )

    DM.DLL
    MSDIS110.DLL
    MSVCMON.EXE
    TLN0T.DLL

    They can be copied to the program directory where you installed your app on the laptop.

    Next the laptop must run the MSVCMON.EXE program to communicate to your development machine. When you run it, you should see a place where you enter the network address of the development PC. When this is running, the laptop is setup for remote debugging.

    On the development machine, go to "Build | Debugger Remote Connection..." and enter the TCP/IP settings for "Network" that will allow you to communicate with the laptop.

    Now, go to the Project Settings again, and choose the Debug option. You will see an edit field that says "Remote executable path and file name". You enter the path of where you placed the executable on the laptop. So for example, if the program is in C:\myapp\app.exe on the laptop, that is what you place here.

    Now, when you start the app, you are actually connecting and running the app on the laptop. You can also set breakpoints on the development machine.

    All of this works if

    1) you can communicate between laptop and development machines via TCP/IP

    AND

    2) Both the laptop and development machines are running the same release build with debug information built into it.

    If there is a failure to get the remote debugging started, it is either 1 or 2 (that is, if I haven't left any steps out).

    I didn't mention about debugging DLL's remotely, but since you are only concerned about an app, I left out this information.

    Maybe this should be in the FAQ?

    Regards,

    Paul McKenzie

  5. #5
    Join Date
    Sep 2002
    Location
    Maryland - Fear The Turtle!
    Posts
    7,537
    in your msdn help, look up remote debug monitor then profit


    here is the link for msdn.microsoft.com

    http://msdn.microsoft.com/library/de...ug_monitor.asp

  6. #6
    Join Date
    Sep 2002
    Location
    Maryland - Fear The Turtle!
    Posts
    7,537
    Originally posted by Paul McKenzie
    Maybe this should be in the FAQ?

    Regards,

    Paul McKenzie
    strange I know I didn't take ten minutes to post that response wonder how I missed your response...ohh well, distractions...

  7. #7
    Join Date
    Oct 2003
    Location
    Chula Vista, CA
    Posts
    51
    Thank you Paul and Mick.
    I got it to the point where I am trying to run the V Studio debugger on the first machine, but it cant find the executable on the remote machine (I am pretty sure I have the path right.....c:\share\filename.exe). Not sure why that is.

    Have either of you guys ever seen an error 183 (GetLastError) when doing a ReadFile? I am trying to read on a serial port, but I keep getting that error (this is the same program by the way). the error is "Cannot create a file when that file already exists"?????? On a Read operation??????

  8. #8
    Join Date
    May 2000
    Location
    KY, USA
    Posts
    18,652
    Originally posted by Paul McKenzie
    Maybe this should be in the FAQ?
    Well...feel free to submit one...
    Ciao, Andreas

    "Software is like sex, it's better when it's free." - Linus Torvalds


    Article(s): Allocators (STL) Function Objects (STL)

  9. #9
    Join Date
    Apr 1999
    Posts
    27,427
    Originally posted by paraglidersd
    Thank you Paul and Mick.
    I got it to the point where I am trying to run the V Studio debugger on the first machine, but it cant find the executable on the remote machine (I am pretty sure I have the path right.....c:\share\filename.exe). Not sure why that is.
    OK. You need to specify the name of the local version of the EXE in the Debug tab under "Executable for debug session" as well as the remote version (which I did mention in my previous post). I left that step out, but possibly this will fix your problem
    Have either of you guys ever seen an error 183 (GetLastError) when doing a ReadFile? I am trying to read on a serial port, but I keep getting that error (this is the same program by the way). the error is "Cannot create a file when that file already exists"?????? On a Read operation??????
    Could be one of those errors that the OS throws at you sometimes that has little to do with what the actual problem is.

    Regards,

    Paul McKenzie

  10. #10
    Join Date
    Oct 2003
    Location
    Chula Vista, CA
    Posts
    51
    Howdy guys. Well, I finally figured out what the problem was (through trial and error). The problem had nothing to do with ReadFile. This program uses a logging function that I inherited from some other code. The logging code writes log information to a file. Unfortunately, it triggers an error 183. Sooo, I had code like such.

    ReadFile(.....);
    Log ("log") << some_var;
    int error = GetLastError();

    I was under the assumption (falsely) that the error code would only get triggered by calls to MS related functions. I was way wrong.

    There is probably a better answer, but for now I have put logic in the Log functions to save and SetLastError() after the logging is done.

    Thanks guys for all of your help. I very much appreciate it.

    Bill

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center