// Create new project and extended attribute definition System::SharedPtr project = System::MakeObject(); System::SharedPtr attribute = ExtendedAttributeDefinition::CreateTaskDefinition(Aspose::Tasks::CustomFieldType::Cost, Aspose::Tasks::ExtendedAttributeTask::Cost1, u""); attribute->set_Formula(u"[Cost]-[Actual Cost]"); project->get_ExtendedAttributes()->Add(attribute); // Add task System::SharedPtr task = project->get_RootTask()->get_Children()->Add(u"Task"); // Create extended attribute System::SharedPtr extendedAttribute = attribute->CreateExtendedAttribute(); task->get_ExtendedAttributes()->Add(extendedAttribute); // Display if extended attributes are read only or not System::Console::WriteLine(extendedAttribute->get_ValueReadOnly() == true ? System::String(u"Value is Read only") : System::String(u"Value is not read only")); extendedAttribute->set_NumericValue(-System::Decimal(1000000)); System::Console::WriteLine(extendedAttribute->get_NumericValue() == -System::Decimal(1000000) ? System::String(u"Formula values are read-only") : System::String(u"Values are not read-only"));