Hi,
The interface of PageBase::Create function is:
BOOL Create(LPCSTR lpcszTemplate = NULL, int iOption = CREATE_VISIBLE | CREATE_KEEP_LAYER_NAMES);
The first argument is Template, not name. If want to rename newly created page, can use
int Rename(LPCSTR lpcszNewName, BOOL bAskIfAlreadyUsed = FALSE, BOOL bLongName = FALSE);
So can change this codes to:
int CreateLayoutPage()
{
LayoutPage lp;
if(lp.Create("Origin", CREATE_VISIBLE | CREATE_NO_DEFAULT_TEMPLATE))
{
lp.Rename("LayoutMaster");
return 1;
}
else
return 0;
}
Iris