Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Access violation while trying to create an element

adidasadidas Posts: 2Member
Hey guys!

I'm kind of new to XML using VC++ 6.0.
I know XML DOM and XML MiniDOM from python...

anyway, I try to create an element, or a node,
and as I run my little application it carshed due to "Access violation"
the exception occures in the functions
raw_createElement(...) and raw_createNode(...)

it happens all the time, and frankly I really don't know what the heck is wrong in there....

here is a fragment of my source:

#define PHONEBOOK_NODE _T("Node")
sprintf(node, "%ld", m_NodeID);
l_XMLNode = m_pDomDocument->createNode(l_vtType, _T(node), _T(""));
l_XMLElement = m_pDomDocument->createElement(PHONEBOOK_NODE);

where:
m_pDomDocument is IXMLDOMDocument2Ptr
l_XMLNode is IXMLDOMNodePtr
l_XMLElement is IXMLDOMElementPtr

I'll be very glad (and so my boss) if someone will be kind to
share his or her opinion about that...

thanx,
Adidas

Comments

  • zibadianzibadian Posts: 6,349Member
    : Hey guys!
    :
    : I'm kind of new to XML using VC++ 6.0.
    : I know XML DOM and XML MiniDOM from python...
    :
    : anyway, I try to create an element, or a node,
    : and as I run my little application it carshed due to "Access violation"
    : the exception occures in the functions
    : raw_createElement(...) and raw_createNode(...)
    :
    : it happens all the time, and frankly I really don't know what the heck is wrong in there....
    :
    : here is a fragment of my source:
    :
    : #define PHONEBOOK_NODE _T("Node")
    : sprintf(node, "%ld", m_NodeID);
    : l_XMLNode = m_pDomDocument->createNode(l_vtType, _T(node), _T(""));
    : l_XMLElement = m_pDomDocument->createElement(PHONEBOOK_NODE);
    :
    : where:
    : m_pDomDocument is IXMLDOMDocument2Ptr
    : l_XMLNode is IXMLDOMNodePtr
    : l_XMLElement is IXMLDOMElementPtr
    :
    : I'll be very glad (and so my boss) if someone will be kind to
    : share his or her opinion about that...
    :
    : thanx,
    : Adidas
    :
    Did you initialize the interfaces? If you didn't then you must do that before trying to call any of their members.
  • adidasadidas Posts: 2Member
    : : Hey guys!
    : :
    : : I'm kind of new to XML using VC++ 6.0.
    : : I know XML DOM and XML MiniDOM from python...
    : :
    : : anyway, I try to create an element, or a node,
    : : and as I run my little application it carshed due to "Access violation"
    : : the exception occures in the functions
    : : raw_createElement(...) and raw_createNode(...)
    : :
    : : it happens all the time, and frankly I really don't know what the heck is wrong in there....
    : :
    : : here is a fragment of my source:
    : :
    : : #define PHONEBOOK_NODE _T("Node")
    : : sprintf(node, "%ld", m_NodeID);
    : : l_XMLNode = m_pDomDocument->createNode(l_vtType, _T(node), _T(""));
    : : l_XMLElement = m_pDomDocument->createElement(PHONEBOOK_NODE);
    : :
    : : where:
    : : m_pDomDocument is IXMLDOMDocument2Ptr
    : : l_XMLNode is IXMLDOMNodePtr
    : : l_XMLElement is IXMLDOMElementPtr
    : :
    : : I'll be very glad (and so my boss) if someone will be kind to
    : : share his or her opinion about that...
    : :
    : : thanx,
    : : Adidas
    : :
    : Did you initialize the interfaces? If you didn't then you must do that before trying to call any of their members.
    :

    yes, off-course, I initialized the m_pDomDocument.

Sign In or Register to comment.