The Starting and Restarting the Workplace Shell technique can also be used when a source level debugger is needed. Follow the same steps as outlined in that section, but instead of simply invoking PMSHELL, invoke the debugger, as follows:

   IPMD PMSHELL

The debugger initializes, but the Workplace Shell does not start running. The steps to be followed are:

The Workplace Shell will then initialize (very slowly) and the debugger will stop when one of the specified breakpoints is reached.

Debugging a Workplace Shell application using IPMD will be much the same as debugging a PM application. Remember that if you manually enter the name of a class or instance variable into IPMD, you must prefix the name with somThis instead of using the underscore ( _ ) macro. In the sample code fragment illustrated in the following figure, to manipulate the _hIcon variable in IPMD, use somThishIcon instead of _hIcon (selecting _hIcon with the mouse works as expected).

/****************************************************//*  Method: wpclsInitData                           */
/*                                                  */
/*  This sample shows how to initialize class data  */
/ *  associated with MyDataBase.                    */
/****************************************************/

SOM_Scope void SOMLINK MyDataBaseM_wpclsInitData(M_MyDataBase *somSelf)
{
  /* M_MyDataBaseData *somThis = M_MyDataBaseGetData(somSelf); */
  M_MyDataBaseMethodDebug("M_MyDataBase","MyDataBaseM_wpclsInitData");

  hModule = _clsQueryModuleHandle(somSelf);

  _hIcon = WinLoadPointer(HWND_DESKTOP, hModule, ID_WINDOW);

  parent_wpclsInitData(somSelf);
}


[Back] [Next]