Some sample declarations:

  LoreConnection lc;
  LR lr;
  RC rc;
  HRESULT hr;

  To connect to Lore:

  lr = lc.Connect("geo",&trapErrors,FALSE,TRUE);
  if (lr != LR_OK) {
    printf("Could not connect to database\n");
    lc.Disconnect();
    exit(1);
  }
 
  To disconnect from Lore:

  lc.Disconnect(TRUE);

  To submit query to Lore:

  lr = lc.Submit(query, &oem);
  if (lr != OK_RETURN) {
    cout << "Fatal Error" << endl;
    lc.Disconnect(TRUE);
    exit(1);
  }

  
  Some declarations:

  IXMLElement *result, *child, *grandChild;
  IXMLElementCollection *children, *grandChildren;
  char *sResult, *tName;
  char *eValue;

  Convert oem object into XML Element:

  result = new IXMLElement(oem,NULL); 

  Print XML Element to string:

  rc = lc.XMLPrintElement(result, sResult, FALSE); 
  cout << "sResult = " << sResult << endl;

  Get Children nodes:

  hr = result->GetChildren(&children, IXML_SEMANTIC, FALSE);  

  Get number of children nodes:
 
  children->GetLength(&nChildren);

  Get ith child node:

  hr = children->Item(i, &child);

  Get Text Value of node:

  hr = child->GetText(&eValue);

  Get attribute value:

  strcpy(aName,"capital");
  hr = child->GetAttribute(aName,(void **) &aValue, IXML_SEMANTIC);

  Get Tag Name:

  hr = child->GetTagName(&tag);