In CVI 6.0 running under Windows 2000, I've had very little success getting PrintPanel to select a different printer.
I set PrintPanel to show the Confirm Dialog Box:
prnErr = PrintPanel (panelHandle, "", 1, VAL_VISIBLE_AREA, 1);
The Print dialog box that then pops up shows the printer that PrintPanel will be using.
As you said in your last message, it seems like PrintPanel ignores SetPrintAttribute (ATTR_PRINTER_NAME, "anyprinter").
It also doesn't seem to recognize a change in the default printer. I changed default printers from Start >> Settings >> Printers. PrintPanel didn't see the change. I used the SDK function SetDefaultPrinter. PrintPanel didn't see the change. (I used the Start menu to verify that the default had been changed).
PrintPanel seems to go off the PrinterPorts list in the registry. Whatever printer is on top of the list is used by PrintPanel, regardless of which printer is the default. My default printer was on top of the list. I went to Start >> Settings >> Printers and deleted the printer which was my default. PrintPanel then used the printer now on top of the PrinterPorts list, even though that printer was not the default.
Then I found this Microsoft Knowledgebase article about removing a network printer.
http://support.microsoft.com/kb/q188697/
After I deleted the registry keys, I was able to use SetDefaultPrinter and PrintPanel to select two of the six printers I had installed, but not all of them.
Anyway, you can try something like this:
Add ...\CVI\SDK\lib\WinSpool.lib to your project
#include < windows.h > // delete spaces around windows.h
#include < winspool.h > // delete spaces around winspool.h
//...
DWORD size = MAX_PATHNAME_LEN;
char prevDefaultPrn[MAX_PATHNAME_LEN];
int prnErr;
//...
GetDefaultPrinter((LPSTR) prevDefaultPrn, &size);
// set the default to the new printer
SetDefaultPrinter((LPSTR) "\\\\nt1emr\\oilfield");
prnErr = PrintPanel (panelHandle, "", 1, VAL_VISIBLE_AREA, 1);
// restore the previous default printer
SetDefaultPrinter((LPSTR) prevDefaultPrn);