Microsoft KB Archive/131058

= Descriptions of tips for remote debugging with Visual C++ versions 2.x, 4.0, 5.0, and 6.0 =

Article ID: 131058

Article Last Modified on 4/22/2005

-

APPLIES TO


 * Microsoft Visual C++ 2.0 Professional Edition
 * Microsoft Visual C++ 2.1
 * Microsoft Visual C++ 4.0 Standard Edition
 * Microsoft Visual C++ 4.2 Enterprise Edition
 * Microsoft Visual C++ 5.0 Enterprise Edition
 * Microsoft Visual C++ 6.0 Enterprise Edition
 * Microsoft Visual C++ 4.2 Professional Edition
 * Microsoft Visual C++ 5.0 Professional Edition
 * Microsoft Visual C++ 6.0 Professional Edition
 * Microsoft Visual C++ 6.0 Standard Edition

-



This article was previously published under Q131058



SUMMARY
Chapter 14 of the Visual C++ User's Guide for Visual C++ version 2.x and Chapter 17 of the Visual C++ User's Guide for Visual C++ version 4.0 describe how to install the Remote Debug Monitor (Msvcmon.exe) and how to configure the remote connection. Query on "Remote Debug" if you are using Visual C++ versions 5.0 and 6.0. This article provides further details and gives two methods to help you get started. Note that Visual C++ versions 4.2 and 5.0 do not support WIN32S and Macintosh platforms; versions 5.0 and 6.0 do not support Serial connection.



MORE INFORMATION
The remote debug monitor is a small program on the target computer that communicates with the debugger and controls the execution of the program you are debugging.

To install the remote debug monitor:
 * On a Windows 95 or NT computer, the remote debug monitor consists of the following files: Msvcmon.exe, Msvcrt40.dll, Tln0com.dll, Tln0t.dll, and Dmn0.dll. Copy these files to the remote computer.

If you are using Visual C++ version 5.0, then copy Msvcmon.exe, Msvcrt.dll, Tln0t.dll, Dm.dll, Msvcp50.dll and Msdis100.dll to the remote computer. If the remote computer is Windows NT 4.0, then copy Psapi.dll also.

If you are using Visual C++ version 6.0, the remote debug monitor consists of the following files: Msvcmon.exe, Msvcrt.dll, Tln0t.dll, Dm.dll, Msvcp60.dll, and Msdis110.dll. For Windows NT only, the remote debugger also requires psapi.dll. Copy these files to a remote target computer directory, move Msvcrt.dll to the System32 directory, and restart. If you are using Windows 95 or Windows 98, move the msvcrt.dll file to the Windows System driectory and restart.
 * On a Win32s computer, the remote debug monitor consists of Msvcmon.exe, Tlw3com.dll, and Dmw3.dll. These files are installed automatically during setup.
 * On a Macintosh, the remote monitor is a control panel, called VC++ Debug Monitor, installed automatically by the Visual C++ for Macintosh setup program.
 * On a Power Macintosh, the remote debugger is an application, called VC++ PowerMac Remote Monitor, installed automatically by the Visual C++ for Macintosh setup program. Setup also installs the following files: VC++ Power Macintosh File Utility, VC++ Power Macintosh ADSP Transport, VC++ Power Macintosh TCP/IP Transport, and VC++ Power Macintosh Serial Transport.

Method one - Windows NT Host, Win32s remote
If you are using Visual C++ versions 4.2 and 5.0, the host and remote machines can be either a Windows NT machine or a Windows 95 machine, as can the local machine. Therefore, the project can reside in the local machine of your choice.
 * 1) Set up a shared directory that both the local Windows NT machine and the remote machine can view. The shared directory can be on either machine or a network drive. The easiest option is to share the directory on the local Windows NT machine that contains the project's executable.
 * 2) Load the project into the Visual C++ development environment running on Windows NT.
 * 3) Open the Project Setting dialog box. (In Visual C++ 2.x, choose Settings from the Project menu; in Visual C++ 4.0, choose Settings from the Build menu; in Visual C++ 5.0 and 6.0, choose Settings from the Project menu.) Click the Debug tab. Set the following sections:
 * 4) * Executable for Debug Session: Enter the name and path of the executable as the local Windows NT computer sees it.
 * 5) * Additional DLLs: Enter the name and path of any DLLs as the local Windows NT computer sees them.
 * 6) * Remote Executable Path: Enter the name and path of the executable as the remote computer sees it.
 * 7) * Working Directory: Should be blank.
 * 8) Start the remote debugger on the remote computer by starting MSVCMON.EXE. For the Win32s platform, find the Visual C++ Win32s program group, and select the Visual C++ Debug Monitor icon. Choose the connect button to start the connection.
 * 9) On the Windows NT host computer, check the connection information. In the Visual C++ 2.x, choose Options from the Tools menu. Then click the Debug tab. Make sure Remote Debugging is selected. Choose the Connections button, and confirm the type of connection. Also, click Settings and confirm the settings. In Visual C++ 4.0, choose Remote Connection from the Tools menu. Confirm the choices for Platform and Connection. Click Settings to configure the specified connection.

In Visual C++ 5.0 and 6.0, choose Debugger Remote connection from the Build menu. Choose Network (TCP/IP) then Settings. Enter remote machine name or IP address, no password needed. You can ignore the symbolic information not found messages for the system DLLs when the debugger is started in Step 6 below.

Note For Intel (x86) machines, Visual C++ 2.x only supports remote debugging via serial connections. In Visual C++ 4.0, it is possible to debug using a network connection with TCP/IP except on Win32s, which requires a serial connection.
 * 1) Start Debugging.

Method two
If you can't make a shareable directory, copy the executable and any needed DLLs to the remote computer. With this method you need to be sure that the executables and DLLs are re-copied whenever changes are made. All the other steps remain the same.

Troubleshooting
If the development environment can't find the executable, make sure the correct directories for the correct computers are given in step 3.

Because Visual C++ version 5.0 supports only TCP/IP connection, check for correct machine name and proper network connection with TCP/IP protocol available. The following troubleshooting does not apply to version 5.0 or 6.0.

If the connection fails:
 * Test the COM port by running Terminal (a Windows version 3.x and Windows NT applet) on both your Windows NT computer and your Win32s computer. (For information on how to use Terminal, please see your Windows manual.) Anything typed into Terminal on one computer should show up in Terminal on the other.
 * Check the COM port settings. The most reliable setting is 9600 baud with XON/XOFF.
 * Try a different cable (a null modem cable).
 * Try a different COM port.
 * If you are using the Windows debug kernel, use the normal kernel.
 * On Win32s, complete a Windows clean boot, and do not start any applications other than the remote monitor.

For more information about how to perform a clean boot, click the following article numbers to view the articles in the Microsoft Knowledge Base:

87290 What is a clean boot for Windows 3.1?

90511 What is a clean boot for Windows for Workgroups?

Keywords: kbhowto kbinfo kbtshoot kbbug kbide kbdebug KB131058

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.