Ruben1717
asked on
How do I pass a CImage object to a control that accepts a LPDISPATCH parameter?
I am having problems loading a picture into a control.
I need to load files into the control at run time.
The IDispatch wrapper class for the control looks like this:
class aPictReaderctrl : public CWnd {
...
void SetPicture(LPDISPATCH propVal) {....}
}
I am using CImage to load a picure like this:
aPictReaderctrl cPicureCtl;
CString strPicture = "SomePicture.tif";
CImage ciPicure;
HRESULT hResult = ciPicure.Load(strPicture );
cPicureCtl.SetPicture(???? ??);
I could pass the CImage into a picure control.
CStatic m_PictureBx;
m_PictureBx.SetBitmap((HBI TMAP)ciPic ure);
cPicureCtl.SetPicture(m_Pi ctureBx.Ge tDispatchI ID( ????? ));
but then, what do I use in the parameter to GetDispatchIID( IID *pIID )?
I don't know if there is an easier approach.
Could someone help me?
I need to load files into the control at run time.
The IDispatch wrapper class for the control looks like this:
class aPictReaderctrl : public CWnd {
...
void SetPicture(LPDISPATCH propVal) {....}
}
I am using CImage to load a picure like this:
aPictReaderctrl cPicureCtl;
CString strPicture = "SomePicture.tif";
CImage ciPicure;
HRESULT hResult = ciPicure.Load(strPicture );
cPicureCtl.SetPicture(????
I could pass the CImage into a picure control.
CStatic m_PictureBx;
m_PictureBx.SetBitmap((HBI
cPicureCtl.SetPicture(m_Pi
but then, what do I use in the parameter to GetDispatchIID( IID *pIID )?
I don't know if there is an easier approach.
Could someone help me?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
>>Thank you very much, it worked.
Then why Grade 'B' ????
MAHESH
Then why Grade 'B' ????
MAHESH
ASKER
I am so sorry, I had selected "A", I think you deserve an "A". I must have accidently clicked on "B". I got a popup window from my test program, just before I clicked submit, and I must have selected the wrong grade when I reenactivated the screen. My apologies.
I am trying to correct the grade now.
I am trying to correct the grade now.
ASKER