The following C++ sample demonstrates how to apply a Profile to a Printer using the BlackIceDEVMODE.dll.
#include "BlackIceDEVMODE.h"
void SetProfileFile(LPCTSTR szPrinterName, LPCTSTR szProfileFile)
{
// Loading current printer settings.
BlackIceDEVMODE* pDevmode = LoadBlackIceDEVMODE(szPrinterName);
// Applying the settings in the profile.
ApplyProfileFile(szPrinterName, szProfileFile, pDevmode);
// Saving the printer settings for the current user.
SaveBlackIceDEVMODE(szPrinterName, pDevmode);
// Freeing the used memory.
ReleaseBlackIceDEVMODE(pDevmode);
}