TableDestinationItem:: TableDestinationItem( LSPTR(LSXLsiSession) pContainer, NotesItem& item)
: LSXBase((LSPLTSTR)"TableDestinationItem", pContainer->LSXGetInstance(), CTABLEBUILDER_TABLEDESTINATIONITEM_ID, pContainer),

TableList(LSNULL),m_BaseNotesItem(item)

{

NotesDocument domBEDoc;
m_BaseNotesItem=item;


try
{
domBEDoc=m_BaseNotesItem.GetProp(CNOTES_IPROP_PARENT).getForeignObject();
NOTEHANDLE noteHandle=(NOTEHANDLE)domBEDoc.GetProp(CNOTES_NPROP_HANDLE).getLong();
NSFNoteGetInfo(noteHandle,_NOTE_DB,&m_DBHandle);
saved=false;

pContainer->GetLNNotesSession().GetDatabase(m_DBHandle, &m_LNDB);
m_LNDB.Open();
m_LNDB.GetDocument(noteHandle,&m_LNDoc);
m_LNDoc.Open();
LNString itemName=(char*) m_BaseNotesItem.GetProp(CNOTES_IPROP_NAME).getString();
m_LNDoc.GetItem(itemName,&m_LNRTItem);
p_LNRTItem=m_LNRTItem;
m_Notehandle=noteHandle;

}
catch(LNSTATUS error)
{
char buff[128];
LNGetErrorMessage(error,buff,128);

//in case of trouble here give back the handle
m_DBHandle=0;
if(!saved)
m_LNDoc.GetNoteHandle();
m_LNDB.GetDatabaseHandle();
m_LNDB.Close();

this->LSXRaiseError(ERR_TABLEBUILDER_OBJECT_NOT_SET);
}
catch(...)
{
//in case of trouble give back the handle
m_DBHandle=0;
if(!saved)
m_LNDoc.GetNoteHandle();
m_LNDB.GetDatabaseHandle();
m_LNDB.Close();
this->LSXRaiseError(ERR_TABLEBUILDER_OBJECT_NOT_SET);
}


}
[email protected]