Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. COM
  4. MSXML implementing ISAXContentHandler, what on earth am I missing??

MSXML implementing ISAXContentHandler, what on earth am I missing??

Scheduled Pinned Locked Moved COM
tutorialhelpquestion
5 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Senkwe Chanda
    wrote on last edited by
    #1

    I've read the docs and a few online examples of how to implement the ISAXContentHandler interface. Simple enough. In my "stdafx.h" file, I make sure to add the following two lines. import using namespace MSXML2; Cool, I then created a class derived from ISAXContentHandler, call it ContentHandlerBase. I implemnted each of the ISAXContentHandler methods such that they all return S_OK. Then, I created a class that derived from ContentHandlerBase, call it ContentHandlerImpl. In this class I only implemented one method, say ISAXContentHandler::startElement for example. As soon as I tried to instantiate this class via ContentHandlerImpl* chi = new ContentHandlerImpl(), I got "Cannot Instantiate Abstract Class" along with a whole bunch of ... HRESULT MSXML2::ISAXContentHandler::raw_ignorableWhitespace(unsigned short *,int)' : pure virtual function was not defined for example, for each of the ISAXContentHandler methods even though they HAVE been implemented in the base class. I don't get, it. I downloaded an online sample and it compiled fine. Laboriously poring over the differences between my code and the sample code has proved fruitless as I can't see anything I did wrong :-( Anybody have any clues as to what might be the problem? Thanks. Senkwe Woke up this morning...and got myself a blog

    A 1 Reply Last reply
    0
    • S Senkwe Chanda

      I've read the docs and a few online examples of how to implement the ISAXContentHandler interface. Simple enough. In my "stdafx.h" file, I make sure to add the following two lines. import using namespace MSXML2; Cool, I then created a class derived from ISAXContentHandler, call it ContentHandlerBase. I implemnted each of the ISAXContentHandler methods such that they all return S_OK. Then, I created a class that derived from ContentHandlerBase, call it ContentHandlerImpl. In this class I only implemented one method, say ISAXContentHandler::startElement for example. As soon as I tried to instantiate this class via ContentHandlerImpl* chi = new ContentHandlerImpl(), I got "Cannot Instantiate Abstract Class" along with a whole bunch of ... HRESULT MSXML2::ISAXContentHandler::raw_ignorableWhitespace(unsigned short *,int)' : pure virtual function was not defined for example, for each of the ISAXContentHandler methods even though they HAVE been implemented in the base class. I don't get, it. I downloaded an online sample and it compiled fine. Laboriously poring over the differences between my code and the sample code has proved fruitless as I can't see anything I did wrong :-( Anybody have any clues as to what might be the problem? Thanks. Senkwe Woke up this morning...and got myself a blog

      A Offline
      A Offline
      Anonymous
      wrote on last edited by
      #2

      Try to use "raw_interfaces_only" attibute in import statement or rename methods in your implementation class ("raw_XXX"). Edward

      S 1 Reply Last reply
      0
      • A Anonymous

        Try to use "raw_interfaces_only" attibute in import statement or rename methods in your implementation class ("raw_XXX"). Edward

        S Offline
        S Offline
        Senkwe Chanda
        wrote on last edited by
        #3

        Hi, thanksk alot for the response :-) Unfortunately, your suggestion doesn't seem to work. I've already tried including "raw_interfaces_only", didn't work I'm afraid. I've just now tried your "raw_XXX" suggestion and I still got the same compile error. Thanks again for the suggestions though :-) Woke up this morning...and got myself a blog

        A 1 Reply Last reply
        0
        • S Senkwe Chanda

          Hi, thanksk alot for the response :-) Unfortunately, your suggestion doesn't seem to work. I've already tried including "raw_interfaces_only", didn't work I'm afraid. I've just now tried your "raw_XXX" suggestion and I still got the same compile error. Thanks again for the suggestions though :-) Woke up this morning...and got myself a blog

          A Offline
          A Offline
          Anonymous
          wrote on last edited by
          #4

          That's strange. What's in *.tlh/*.tli files ? Your derived classes should match interfaces in the *.tlh files. Also try to remove all tlh and tli files and rebuild all. Edward

          S 1 Reply Last reply
          0
          • A Anonymous

            That's strange. What's in *.tlh/*.tli files ? Your derived classes should match interfaces in the *.tlh files. Also try to remove all tlh and tli files and rebuild all. Edward

            S Offline
            S Offline
            Senkwe Chanda
            wrote on last edited by
            #5

            Hi Edward. Thanks for the reply again. I took a peek at the projects *.tlh file and my eyes glazed over so I deleted it and rebuilt all. Same thing happened. Looks like I'm going to have to dig into the file and look for anything odd. Thanks for your help :-) I'll post this problem to another newsgroup as I'm sure someone must have experienced this before. :-) Woke up this morning...and got myself a blog

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups