HOW TO: Debug the Sample Gateway as a Console Application (199087)



The information in this article applies to:

  • Microsoft Exchange Development Kit (EDK) 4.0
  • Microsoft Exchange Development Kit (EDK) 5.0
  • Microsoft Exchange Development Kit (EDK) 5.5

This article was previously published under Q199087

SUMMARY

This step-by-step article explains how to configure the sample gateway application to run as a console program. This arrangement makes it easier to run the gateway in the debugger and to step through the code. It is assumed that you have already installed the sample gateway.

In order to run the sample gateway as a console application rather than as a service, it's necessary to link the sample gateway with WinWrap.lib. You will also need to provide the command line arguments notserv and Long Name of the Service.

back to the top

Configure the Sample Gateway Application

  1. Compile Winwrap using debug build configuration. Winwrap is found at \MSSDK\Samples\Dbmsg\Exchange\Libsrc\Winwrap.
  2. Move the Winwrap.lib to the Mssdk\Lib directory.
  3. Open the sample gateway project in Visual C++. The gateway sample application is found at \MSSDK\Samples\Dbmsg\Exchange\Gwsample\Gwsample.dsp
  4. Add Winwrap.lib to the Link tab of the Project Settings.
  5. Locate the Long Name of the Service in the registry under HKLM\System\CurrentControlSet\Services. It appears as a key name. For more information, see the following Note.
  6. Select Projects Settings on the Debug tab, set the program arguments to "notserv <Long Name of Service>".
  7. Verify that IPM_OUT.dll and IPM_IN.dll are located in the (windir)\System32 directory.
  8. Build the sample gateway project.
  9. Set a break point and Debug-Go.
NOTE: If your sample gateway was installed according to Microsoft Knowledge Base article Q200669, then the key name will be equal to the value of the /service parameter supplied on the Servinst command line. If your sample gateway was installed with GWSetup, then the key name will be a GUID under HLM\System\CurrentControlSet\Services. If multiple GUIDs are present, it may be necessary to examine the DisplayName and ImagePath values to find the correct key.

back to the top

Modification Type:MinorLast Reviewed:3/4/2004
Keywords:kbhowto kbHOWTOmaster kbMsg KB199087 kbAudDeveloper