1// 假设源对象为oriObj
2
3ObjectPtr newObj = NULL;
4ObjectPtr dialogObj = NULL;
5SetOfStrings extraStr = NULL;
6SetOfObjects extraObj = NULL;
7
8ConstructItem(AssemblyClass, mfail, &newObj);
9SetUpDialog(AssemblyClass, newObj, "CreateDialogC", &extraStr, &extraObj, &dialogObj, mfail);
10SetDialogDefaults(dialogObj, AssemblyClass, newObj, &extraStr, &extraObj, mfail);
11// 从源对象COPY属性到对话框对象的相同属性上
12objCopyLikeAttributes(oriObj, dialogObj);
13// 设置一些特殊的属性
14objSetAttribute(dialogObj, PartNumberAttr, strPrtNumCpy);
15objSetAttribute(dialogObj, bbkSpecModelAttr, strSpcMdlCpy);
16dstat = objSetAttribute(dialogObj, bbkIsAutoNamingAttr, "-");
17// 创建新对象
18ValidateDialog(dialogObj, AssemblyClass, newObj, &extraStr, &extraObj, &bagArgs, mfail);
19OKButton(dialogObj, AssemblyClass, NULL, newObj, &extraStr, &extraObj, &keepInteract, mfail);
2
3ObjectPtr newObj = NULL;
4ObjectPtr dialogObj = NULL;
5SetOfStrings extraStr = NULL;
6SetOfObjects extraObj = NULL;
7
8ConstructItem(AssemblyClass, mfail, &newObj);
9SetUpDialog(AssemblyClass, newObj, "CreateDialogC", &extraStr, &extraObj, &dialogObj, mfail);
10SetDialogDefaults(dialogObj, AssemblyClass, newObj, &extraStr, &extraObj, mfail);
11// 从源对象COPY属性到对话框对象的相同属性上
12objCopyLikeAttributes(oriObj, dialogObj);
13// 设置一些特殊的属性
14objSetAttribute(dialogObj, PartNumberAttr, strPrtNumCpy);
15objSetAttribute(dialogObj, bbkSpecModelAttr, strSpcMdlCpy);
16dstat = objSetAttribute(dialogObj, bbkIsAutoNamingAttr, "-");
17// 创建新对象
18ValidateDialog(dialogObj, AssemblyClass, newObj, &extraStr, &extraObj, &bagArgs, mfail);
19OKButton(dialogObj, AssemblyClass, NULL, newObj, &extraStr, &extraObj, &keepInteract, mfail);