const GUID guidEntryPoint { 0x71e456a5, 0x6a4e, 0x46aa, { 0xa7, 0x27, 0x10, 0x5d, 0x58, 0x4c, 0x79, 0x17 } };
const
GUID
public static readonly Guid guidEntryPoint = new Guid("71E456A5-6A4E-46aa-A727-105D584C7917");
public
static
readonly
Guid
new
"71E456A5-6A4E-46aa-A727-105D584C7917"
WSupplies* pSupplies; WSupplies::Create(&pSupplies, pDomain, &DataFS::OBJECTID_NULL);
WSupplies
WSupplies pSupplies; WSupplies.Create(out pSupplies, pDomain, DataFS.ObjectId.OBJECTID_NULL);
out
ObjectId
pDomain->InsertNamedLink(&pSupplies->BuildLink(true), &guidEntryPoint, L"basic entry point");
true
"basic entry point"
pDomain.InsertNamedLink(pSupplies.BuildLink(true), guidEntryPoint, "basic entry point", Transaction.Store);
Transaction
DataFS::stcObjectLink* pSuppliesLink; pDomain->QueryNamedLink(&guidEntryPoint, 1, &pSuppliesLink, NULL); WSupplies* pSupplies = NULL; WSupplies::Open(&pSupplies, pDomain, *pSuppliesLink);
stcObjectLink
NULL
DataFS.Array<DataFS.stcObjectLink> apSuppliesLink = new DataFS.Array<DataFS.stcObjectLink>(); pDomain.QueryNamedLink(aguidEntryPoint, apSuppliesLink, null); WSupplies pSupplies = null; WSupplies.Open(out pSupplies, pDomain, apSuppliesLink.pData[0].oiObjectId, 0, Transaction.Load);
null
WSupplies* pSupplies = NULL; DataFS::stcObjectLink* pSuppliesLink; if(S_OK == pDomain->QueryNamedLink(&guidEntryPoint, 1, &pSuppliesLink, NULL)) { if(WSupplies::IsOfType(pSuppliesLink)) { WSupplies::Open(&pSupplies, pDomain, *pSuppliesLink); pSupplies->Load(); DataFSAccess::MemFree(pSuppliesLink); if(FAILED(pDomain->Execute(Transaction::Load, NULL))) { wprintf(L"Execute failed...\n"); uninit(pConnection, pDomain, ulStorageId); return -1; } } else { DataFSAccess::MemFree(pSuppliesLink); wprintf(L"Object is not of type WSupplies\n"); } } else { WSupplies::Create(&pSupplies, pDomain, &DataFS::OBJECTID_NULL); pDomain->InsertNamedLink(&pSupplies->BuildLink(true), &guidEntryPoint, L"basic entry point"); // Store pSupplies->Store(); // Execute HRESULT hRes; if(FAILED(hRes = pDomain->Execute(Transaction::Store, NULL))) { wprintf(L"Domain failed to execute the transaction (0x%x)\n", hRes); pSupplies->Release(); pSupplies = NULL; } }
if
S_OK
FAILED
"Execute failed...\n"
return
else
"Object is not of type WSupplies\n"
// Store
// Execute
HRESULT
"Domain failed to execute the transaction (0x%x)\n"
WSupplies pSupplies = null; DataFS.Array<DataFS.stcObjectLink> apSuppliesLink = new DataFS.Array<DataFS.stcObjectLink>(); if (0 == pDomain.QueryNamedLink(aguidEntryPoint, apSuppliesLink, null)) { if (WSupplies.IsOfType(apSuppliesLink.pData[0])) { WSupplies.Open(out pSupplies, pDomain, apSuppliesLink.pData[0].oiObjectId, 0, Transaction.Load); pSupplies.Load(_WSupplies.ALL_ATTRIBUTES, Transaction.Load); if (0 > pDomain.Execute(Transaction.Load, null)) { Console.WriteLine("Execute failed..."); uninit(pDomain, ulStorageId); return; } } else Console.WriteLine("Object is not of type WSupplies"); } else { WSupplies.Create(out pSupplies, pDomain, DataFS.ObjectId.OBJECTID_NULL); pDomain.InsertNamedLink(pSupplies.BuildLink(true), guidEntryPoint, "basic entry point", Transaction.Store); // Store pSupplies.Store(Transaction.Store); // Execute int hRes; if (0 > (hRes = pDomain.Execute(Transaction.Store, null))) { Console.WriteLine("Domain failed to execute the transaction (0x{0:x})", hRes); pSupplies = null; } }
"Execute failed..."
"Object is not of type WSupplies"
int
"Domain failed to execute the transaction (0x{0:x})"