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. _variant_t objects, and the like...

_variant_t objects, and the like...

Scheduled Pinned Locked Moved C / C++ / MFC
performancequestion
3 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.
  • F Offline
    F Offline
    funbag
    wrote on last edited by
    #1

    I've got a class with a _variant_t member variable. When I call delete on objects of my class, I get memory leaks. Is there a safe way of getting rid of these objects? Thanks, funbag:-O skydiving....if at first you don't succeed, you're fecked!

    W 1 Reply Last reply
    0
    • F funbag

      I've got a class with a _variant_t member variable. When I call delete on objects of my class, I get memory leaks. Is there a safe way of getting rid of these objects? Thanks, funbag:-O skydiving....if at first you don't succeed, you're fecked!

      W Offline
      W Offline
      woods13
      wrote on last edited by
      #2

      What are you using in the variants? I could see where some problems might occur if you are using safe arrays, but if you are just using the regular variant union variables, then I'm not too sure.. What are the memory leaks saying? Are the leaks explicitly of object of CYourClass? Or are they variant objects? //------------------------   CSignature::Jeff() ;   PostMessage(WM_QUIT) ; //------------------------

      F 1 Reply Last reply
      0
      • W woods13

        What are you using in the variants? I could see where some problems might occur if you are using safe arrays, but if you are just using the regular variant union variables, then I'm not too sure.. What are the memory leaks saying? Are the leaks explicitly of object of CYourClass? Or are they variant objects? //------------------------   CSignature::Jeff() ;   PostMessage(WM_QUIT) ; //------------------------

        F Offline
        F Offline
        funbag
        wrote on last edited by
        #3

        My class is derived from IADORecordBinding, and has the two _variant_t objects. They're used to read an adVariant and an adGUID type from a recordset object, to which my object is bound. The adVariant is just used to store a date from the db, while the GUID is used as a record identifier. When I delete my object, a COM error is raised, 800020008 - bad variable type. The memory leaks seem to be a cascade of the error of not deleteing my object correctly. I hope this helps Thanks, funbag skydiving....if at first you don't succeed, you're fecked!

        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