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. C / C++ / MFC
  4. Creating a list or array of IHTMLElementCollection ptrs

Creating a list or array of IHTMLElementCollection ptrs

Scheduled Pinned Locked Moved C / C++ / MFC
c++data-structureshelpquestion
2 Posts 2 Posters 0 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.
  • J Offline
    J Offline
    Jase Jennings
    wrote on last edited by
    #1

    Hi, I need to store in an array or list, a dynamic number of IHTMLElementCollectionPtr's The array/list needs to be dynamic as each collection represents a set of images from a web page. The number of open internet explorer's can vary, and the user should at any time be able to open up a new IE browser, and refresh my applicaton to represent the images from each browser. I can't use new() on the pointer, because it is the address of the pointer that is supplied to the appropriate IE functions, i just need to create an array of raw pointers. Is there something in the stl which can help me ? I cannot implement a copy constructor for IHTMLElementCollectionPtr's, so that rules out 'list' etc, and I can't use MFC's collection objects as it is not derived from CObject. Any ideas please ? I've tried writing my own class to store these but i'd rather go with something tried and trusted. Jase

    J 1 Reply Last reply
    0
    • J Jase Jennings

      Hi, I need to store in an array or list, a dynamic number of IHTMLElementCollectionPtr's The array/list needs to be dynamic as each collection represents a set of images from a web page. The number of open internet explorer's can vary, and the user should at any time be able to open up a new IE browser, and refresh my applicaton to represent the images from each browser. I can't use new() on the pointer, because it is the address of the pointer that is supplied to the appropriate IE functions, i just need to create an array of raw pointers. Is there something in the stl which can help me ? I cannot implement a copy constructor for IHTMLElementCollectionPtr's, so that rules out 'list' etc, and I can't use MFC's collection objects as it is not derived from CObject. Any ideas please ? I've tried writing my own class to store these but i'd rather go with something tried and trusted. Jase

      J Offline
      J Offline
      jhwurmbach
      wrote on last edited by
      #2

      Jase Jennings wrote: I cannot implement a copy constructor for IHTMLElementCollectionPtr's This requirement seems to rule out ANY STL container, as all of these rely on copying. But IHTMLElementCollectionPtr is a smart-pointer to something COM-ish IIRC? So it most probably already has a copy-constructor and reference counting? If not, you can use the BOOSTlibrary and its shared_ptr-template, which can make any pointer into a reference-counting smart-pointer that is fully STL-capable.


      My opinions may have changed, but not the fact that I am right.

      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