Exemple #1
0
bool CVideoExchange::AddElement(LPCTSTR strName, LPCTSTR strValue)
{
    MSXML::IXMLDOMElementPtr pRoot;
    MSXML::IXMLDOMElementPtr pElem;

    pRoot = m_pDocument->getElementsByTagName(L"CARDVIDEO")->item[0];
    pElem = m_pDocument->createElement(_bstr_t(strName));
    pElem->text = (LPCTSTR)strValue;
    pRoot->appendChild(pElem);
    pElem.Release();
    return true;
}
Exemple #2
0
bool CVideoExchange::Dehydrate(void)
{
    if (m_pDocument)
        m_pDocument.Release();
    MSXML::IXMLDOMElementPtr pRoot;
    MSXML::IXMLDOMElementPtr pElem;
    TCHAR chBuffer[255];

    HRESULT hr = m_pDocument.CreateInstance(L"MSXML.FreeThreadedDOMDocument");
    ASSERT(ERROR_SUCCESS == hr);

    pElem = m_pDocument->createElement(L"CARDVIDEO");
    pRoot = m_pDocument->appendChild(pElem);
    pElem.Release();

    pElem = m_pDocument->createElement(L"BITRATE");
    pElem->text = (LPCTSTR)m_sBitRate;
    pRoot->appendChild(pElem);
    pElem.Release();

    pElem = m_pDocument->createElement(L"FILENAME");
    pElem->text = (LPCTSTR)m_sFileName;
    pRoot->appendChild(pElem);
    pElem.Release();

    pElem = m_pDocument->createElement(L"MPEGFORMAT");
    pElem->text = (LPCTSTR)m_sMPEGFormat;
    pRoot->appendChild(pElem);
    pElem.Release();

    pElem = m_pDocument->createElement(L"CARDID");
    pElem->text = (LPCTSTR)m_sCardId;
    pRoot->appendChild(pElem);
    pElem.Release();

    pElem = m_pDocument->createElement(L"ROOMID");
    pElem->text = _ltot(m_nRoomId,chBuffer,10);
    pRoot->appendChild(pElem);
    pElem.Release();

    pElem = m_pDocument->createElement(L"TIMESTART");
    pElem->text = (LPCTSTR)m_odtStart.Format(_T("%m-%d-%Y %H:%M:%S"));
    pRoot->appendChild(pElem);
    pElem.Release();

    pElem = m_pDocument->createElement(L"TIMESTOP");
    pElem->text = (LPCTSTR)m_odtStop.Format(_T("%m-%d-%Y %H:%M:%S"));
    pRoot->appendChild(pElem);
    pElem.Release();

    pElem = m_pDocument->createElement(L"DURATION");
    pElem->text = _ltot(m_nDuration,chBuffer,10);
    pRoot->appendChild(pElem);
    pElem.Release();

    pElem = m_pDocument->createElement(L"VIDEOSTORAGESERVERID");
    pElem->text = _ltot(m_nVideoStorageServerId,chBuffer,10);
    pRoot->appendChild(pElem);
    pElem.Release();

    pElem = m_pDocument->createElement(L"STREAMINGENCODERID");
    pElem->text = _ltot(m_nStreamingEncoderId,chBuffer,10);
    pRoot->appendChild(pElem);
    pElem.Release();

    pElem = m_pDocument->createElement(L"SESSIONID");
    pElem->text = (LPCTSTR)m_sSessionId;
    pRoot->appendChild(pElem);
    pElem.Release();

    pElem = m_pDocument->createElement(L"SESSIONNAME");
    pElem->text = (LPCTSTR)m_sSessionName;
    pRoot->appendChild(pElem);
    pElem.Release();

    pElem = m_pDocument->createElement(L"DISPLAYNAME");
    pElem->text = (LPCTSTR)m_sDisplayName;
    pRoot->appendChild(pElem);
    pElem.Release();

    pElem = m_pDocument->createElement(L"FILETITLE");
    pElem->text = (LPCTSTR)m_sFileTitle;
    pRoot->appendChild(pElem);
    pElem.Release();
    return false;
}