Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X
I'm stuck. I've run out of ideas, but I must be doing something lame here. My call to ProPrintPCFOptionsGet is returning an empty structure, and that in turn is making ProPrintExecute error out.
//BEGIN CODE
ProMdl model = new ProMdl();
ProMdlCurrentGet(&model);
ProError ret_val = PRO_TK_NO_ERROR;
int win_id;
//initialize options
ProPrintPrinterOpts print_opts;
ProPrintMdlOpts mdl_opts;
ProPrintPlacementOpts placement_opts;
ProPath path = L"C:\\ptc\\location\\printing\\config_file.pcf"; //location to pcf to be used
ret_val = ProWindowCurrentGet(&win_id);
if(ret_val == PRO_TK_NO_ERROR) ret_val = ProPrintPCFOptionsGet(path, model, &print_opts, &mdl_opts, &placement_opts);
if(ret_val == PRO_TK_NO_ERROR) ret_val = ProPrintExecute(win_id, &print_opts, &mdl_opts, &placement_opts);
//END CODE
Anyone see some obvious error in here?
Thx,
Ben Franklin
Hello Ben!
This is the code I'm using in my application.
ProError err;
ProPrintMdlOpts MdlOptions;
ProPrintPrinterOpts PrinterOptions;
ProPrintPlacementOpts PlaceOptions;
ProMdlType MdlType;
err = ProMdlTypeGet(m_Drw, &MdlType);
if (MdlType != PRO_MDL_DRAWING)
return PRO_TK_INVALID_ITEM;
err = ProMdlDisplay(m_Drw);
err = ProMdlWindowGet(m_Drw, &m_WinID);
err = ProWindowActivate(m_WinID);
err = ProWindowRefresh(m_WinID);
err = ProPrintPCFOptionsGet(L"tiff", m_Drw, &PrinterOptions, &MdlOptions, &PlaceOptions);
wcscpy_s(PrinterOptions.filename, PRO_PATH_SIZE, Name);
MdlOptions.use_drawing_size = PRO_B_TRUE;
PrinterOptions.save_to_file = PRO_B_TRUE;
PrinterOptions.send_to_printer = PRO_B_FALSE;
err = ProPrintExecute(m_WinID, &PrinterOptions, &MdlOptions, &PlaceOptions);
return err;