Killing VB IDE with a propery
-
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;zreturn 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 Suband 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