描述:
??
我先定义了一个基础组件。
然后再另一个组件中实现它的接口。
getbitmap(wireHBITMAP *phBitmap)
但我怎么样也传不回去组件里已经定义的句柄。
解决方案1:
return IDispatch* of IPictureDisp* object
OleCreatePictureIndirect
Creates a new picture object initialized according to a PICTDESC structure, which can be NULL to create an uninitialized object if the caller wishes to have the picture initialize itself through IPersistStream::Load. The fOwn parameter indicates whether the picture is to own the GDI picture handle for the picture it contains, so that the picture object will destroy its picture when the object itself is destroyed. The function returns an interface pointer to the new picture object specified by the caller in the riid parameter. A QueryInterface is built into this call. The caller is responsible for calling Release through the interface pointer returned.
STDAPI OleCreatePictureIndirect(
PICTDESC* pPictDesc,
//Pointer to the structure of parameters for picture
REFIID riid, //Reference to the identifier of the interface
BOOL fOwn, //Whether the picture is to be destroyed
VOID** ppvObj //Address of output variable that receives the
// interface pointer requested in riid
);
您可能想查找下面的文章:
- 做一个图像处理控件,HBITMAP,CClientDC,这类的变量用什么变量在COM里?
- OleCreatePropertyFrameIndirect函数如何指定初始显示页?
- Idl中才能用BITMAPFILEHEADER等数据类型呢?
- 在com中使用HBITMAP做接口函数参数的问题
- ATL项目中如何得到LoadBitmap(HINSTANCEhInstance,)中的hInstance?
- DDK里的Bitmap那个驱动的例子,打印完了,生成的BMP文件输出到什么位置去了?
- 在MFC下使用控件接口类CPictureHolder怎么用?使用其CreateFromBitmap函数实现从bitmap图像生成对象时老执行出错!
- 非MFC下LoadBitmap如何使用?
- CBitmapButton或者是制作透明按钮
- 从CBitmap对象的句柄传给OleLoadPicture,创建IPicture失败了,什么原因