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. Killing VB IDE with a propery

Killing VB IDE with a propery

Scheduled Pinned Locked Moved COM
c++visual-studiodebugginghelpquestion
1 Posts 1 Posters 2 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.
  • C Offline
    C Offline
    Chris Losinger
    wrote on last edited by
    #1

    I have an simple ATL object that contains an IPictureDisp * property. (Free-threaded marshalling, free-threaded object, with events, etc.) these are my get/putref functions:

    CComPtr m_pPicture;
    ...

    STDMETHODIMP CMyObj::get_Picture(IPictureDisp **pVal)
    {
    *(pVal) = m_pPicture;

    return S\_OK;
    

    }

    ///////////////////////////////////////////////////////////

    STDMETHODIMP CMyObj::putref_Picture(IPictureDisp *newVal)
    {
    m_pPicture = (IPictureDisp *)newVal;z

    return S\_OK;
    

    }

    in my MFC test app, i create a picture object with OleLoadPicturePath, set the picture property and call the control's output function. my output function does a QueryInterface on m_pPicture to get an IPicture interface, does some work on it, then releases the IPicture interface. this works fine in my MFC test app. the problem occurs in the VB IDE. here's my VB test code:

    Private Sub Command1_Click()
    Dim W As MyObj
    Set W = New MyObj
    Set W.Picture = Picture1.Picture
    End Sub

    and here's how i kill VB: 1. put a breakpoint immediately after my "Set W.Picture = Picture1.Picture" line 2. run the app 3. when the breakpoint hits, hover over the "W" text, this shows some big negative number (i assume this is VBs way of printing an address) 4. hover over the "Picture1" text. the VB IDE crashes immediately. any ideas??? -c

    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