I don't use any of the pmprintf wps functions so I can't say anything about how they work. I just use the standard pmprintf
I define a function pointer to PmPrintf in my class.
ULONG (* _System PmPrintfPtr) (char *Format, ...); // function pointer - for PmPrintf
If I need to create debug output I dynamically load pmprintf.dll, set my function pointer to pmprintf, and turn on a debug variable.
DosLoadModule(&(LoadError[0]), sizeof(LoadError), "pmprintf", &_debugHandle);
DosQueryProcAddr(_debugHandle,0l,"PmPrintf",(PFN *) &PmPrintfPtr);
_debug=1; // my "local variable" for turning on/off debugging
Then in the class I can use
if (_debug) PmPrintfPtr("some debug stuff here");
This allows me to turn on or off debugging for a specific object with a setup string.
The two downsides to this technique are 1) pmprintf.dll stays loaded until the desktop is restarted, and 2) normally setup strings for an object don't get processed until after the object has been initialized, i.e. after wpInitData() and wpRestoreState() have been called. This
If you do decide to take up the wonderful, wacky, frustrating world of WPS programming, I recommend the book
OS/2 Warp Workplace Shell API by Mindy Pollack.
She covers issues that I struggled with that I did not see covered in the regular WPS reference or the WPS Programming guide that comes with OS/2.