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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. how to copy values only from one com object (Interface)

how to copy values only from one com object (Interface)

Scheduled Pinned Locked Moved C / C++ / MFC
comtutorial
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.
  • G Offline
    G Offline
    gpshadrach
    wrote on last edited by
    #1

    eg. IXRect *pRect IXRect *p; mDoc->get_Rect(&p); pRect = p; pls see above the code. whenever i change the member value of p, mDoc.Rect values are changed. also how to avoid it. i want to copy values only from mDoc.Rect Object to p . how to do :doh: shadrach

    P 1 Reply Last reply
    0
    • G gpshadrach

      eg. IXRect *pRect IXRect *p; mDoc->get_Rect(&p); pRect = p; pls see above the code. whenever i change the member value of p, mDoc.Rect values are changed. also how to avoid it. i want to copy values only from mDoc.Rect Object to p . how to do :doh: shadrach

      P Offline
      P Offline
      Prakash Nadar
      wrote on last edited by
      #2

      It all depends how mDoc->get_Rect is implemented, it seems like it is returning the address of existing "rect" hence both the objects are pointing to the same content and hence you are having the problem.


      -Prakash

      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