c++ builder 实现表情和文字的混合发送

本文介绍了如何在C++ Builder中实现表情和文字的混合发送,通过导入imageole.dll库并使用特定的插入图片方法来完成这一功能。
摘要由CSDN通过智能技术生成

1 imageole.dll  导入imageole.dll

2 插入图片方法

void TForm5::InsertPicture(WideString strFilePath,TRichEdit *edit,int i)
{
	 //WideString strFilePath = ExtractFilePath(Application->ExeName)+"1.png";
   //ShowMessage(strFilePath);
	HWND hwndRichEdit = edit->Handle;
	LPLOCKBYTES  lpLockBytes  =  NULL;
	SCODE  sc;
	HRESULT  hr;
	//print  to  RichEdit'  s  IClientSite
	LPOLECLIENTSITE  lpClientSite;
	//A  smart  point  to  IAnimator
	IGifAnimatorPtr lpAnimator;
	//ptr  2  storage
	LPSTORAGE  lpStorage;
	//the  object  2  b  insert  2
	LPOLEOBJECT lpObject;
	//Create  lockbytes
	sc = ::CreateILockBytesOnHGlobal(NULL,  TRUE,  &lpLockBytes);
	if  (sc != S_OK) RaiseLastOSError();

	assert(lpLockBytes != NULL);
	//use  lockbytes  to  create  storage
	sc = ::StgCreateDocfileOnILockBytes(lpLockBytes,
				STGM_SHARE_EXCLUSIVE|STGM_CREATE|STGM_READWRITE, 0, &lpStorage);
	if(sc != S_OK)
	{
		lpLockBytes->Release();
		lpLockBytes = NULL;
		RaiseLastOSError();
	}
	assert(lpStorage != NULL);
	//get  the  ClientSite  of  the  very  RichEditCtrl
	TComInterface<IRichEditOle> pRichEditOle;
	SendMessage(hwndRichEdit,EM_GETOLEINTERFACE,0,(LPARAM)&pRichEditOle);
	if(!pRichEditOle) RaiseLastOSError();
	pRichEditOle->GetClientSite(&lpClientSite);

	assert(lpClientSite != NULL);

	//I
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值