As you might imagine, there is plenty of useful code in XFLDR.DLL -- for graphics, strings, PM controls, and much more. Most of what you see in the "&xwp; helpers" sources is probably in XFLDR.DLL somewhere.

Now, if you want to use that code, you basically have two options.

  1. Copy and paste the functions from the helpers sources (or wherever else from) into your widget code.

  2. The smart way to do this however would be to avoid duplicate code and use the code from XFLDR.DLL. The &xcenter; interfaces allow you to do exactly that:

    When your DLL's "init" export gets called (ordinal 1), it receives the module handle of XFLDR.DLL. You can then use DosQueryProcAddr to resolve the addresses of functions which are exported from XFLDR.DLL, store those function pointers in global variables, and use them instead.

    Again, see the standard widgets in src\widgets\ in the &xwp; sources, which all make use of this feature.

    To make sure the prototypes are correct, many prototypes have already been typedef'd in the various &xwp; header files. Basically, I added a typedef whenever I needed an export myself. Similarly, in src\shared\xwp.def, you will find those functions exported which I needed for the standard plugins. If you need more functions and prototypes, just contact me, and I'll add them.