How do I use tinyxml within a DLL?

  • CodeSmurf

    CodeSmurf - 2011-03-12

    I am struggling with the problem of using tinyXML within a DLL. The XML file I want to read has to be in a resource file. However, tinyXML needs the path to the xml file. I haven't found a way to make that work. Did anyone so far try that?
    Would be really glad for some information that points me into the right direction.

  • CodeSmurf

    CodeSmurf - 2011-03-12

    In case someone else might be facing the same problem, this seems to do the trick:

    HRSRC rsrc = FindResourceA (GetInstance (), "data.xml", "XML");
    HGLOBAL src_txt = LoadResource(GetInstance (), rsrc);
    char * src_char = (char *) LockResource(src_txt);
    TiXmlDocument doc;
    bool loadOkay = doc.Parse(src_char);


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks