The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Copy of a Layoutpage
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Simulation@Knapp

Austria
Posts

Posted - 04/10/2008 :  07:36:11 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi!

I''ve a Layoutpage called "LayoutMaster" (short name and long name) with some static text and rectangle on it.
I want make a copy of this page with method "Create", but ORIGIN is unable to find "LayoutMaster".

Any idea what I did wrong?

Here is the code:


int CreateLayoutPage
{
LayoutPage lp;
if(lp.Create("LayoutMaster", CREATE_VISIBLE | CREATE_NO_DEFAULT_TEMPLATE))
return 1;
else
return 0;
}

Iris_Bai

China
Posts

Posted - 04/15/2008 :  05:04:23 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000