正在阅读:CRichEditCtrl实现MSN/QQ动画表情CRichEditCtrl实现MSN/QQ动画表情

2005-07-11 10:02 出处: 作者:dtianx 责任编辑:moningfeng

ImageOle.tli

1// Created by Microsoft (R) C/C++ Compiler Version 12.00.8168.0 (9de7951a).
2//
3// d:\myproject\msger\debug\ImageOle.tli
4//
5// Wrapper implementations for Win32 type library D:\\Program files\\tencent\\qq\\ImageOle.dll
6// compiler-generated file created 10/25/04 at 22:00:58 - DO NOT EDIT!
7#pragma once
8
9//
10// interface IGifAnimator wrapper method implementations
11//
12
13inline HRESULT IGifAnimator::LoadFromFile ( _bstr_t FileName ) {
14 HRESULT _hr = raw_LoadFromFile(FileName);
15 if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
16 return _hr;
17}
18
19inline VARIANT_BOOL IGifAnimator::TriggerFrameChange ( ) {
20 VARIANT_BOOL _result;
21 HRESULT _hr = raw_TriggerFrameChange(&_result);
22 if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
23 return _result;
24}
25
26inline _bstr_t IGifAnimator::GetFilePath ( ) {
27 BSTR _result;
28 HRESULT _hr = raw_GetFilePath(&_result);
29 if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
30 return _bstr_t(_result, false);
31}
32
33inline HRESULT IGifAnimator::ShowText ( _bstr_t Text ) {
34 HRESULT _hr = raw_ShowText(Text);
35 if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
36 return _hr;
37}


  有了这些,你使用接口和函数就很方便了。

  然后就这样:

  WINOLEAPI CoInitializeEx(LPVOID pvReserved, DWORD dwCoInit)


  为什么要这样呢?因为我们使用这个函数。那有必要这样么?在MSDN是说要 #define _DCOM_ 就行了。可惜我没有成功。就只好这样了。

  接着就是实现代码了。现在看应该没有很大的问题。如果还是很难明白。那么我你得好好研究CRichEditCtrl和OLE了。听说Inside OLE和Inside COM很好。我没有弄到。就看了《COM+编程指南》和潘爱民的《COM原理和应用》,不错!还有一个好东西。就是 ActiveX Control Test Container 的源代码。
键盘也能翻页,试试“← →”键

关注我们

最新资讯离线随时看 聊天吐槽赢奖品