SaveTemplate
Save project as template, including optional description and bitmap for image preview, can view templates from the Template Organizer.
BOOL SaveTemplate( LPCSTR lpcszFile, LPCSTR lpcszBmpFile = NULL, LPCSTR lpcszEMFFile = NULL, LPCSTR lpcszDesc = NULL, DWORD dwCtrl = 0x0 )
Returns TRUE on success and FALSE on failure.
EX1
// save a project as a template, including a description and image preview. void PageBase_SaveTemplate_ex1() { string strBmpFile = "c:\\mybitmap.bmp"; string strTemplateEMF = "c:\\metafile.emf"; string strTemplateFile = "c:\\mytemplate.otp"; string strDescription="Description of template goes here---"; GraphPage pg; pg.Create("origin"); if( pg ) { if(pg.SaveBitmap(strBmpFile, 400)) pg.SaveTemplate(strTemplateFile, strBmpFile, NULL, strDescription); if(pg.SaveBitmap(strTemplateEMF)) pg.SaveTemplate(strTemplateFile, NULL, strTemplateEMF, strDescription); // note: the last non NULL description saved overwrites earlier description. } }
origin.h