现在RichEdit控件可以通过GetSelText方法来获取所选中内容的文本,但只是返回文本内容,选中内容的格式信息并没有返回,不知哪位大侠有办法获取到选中内容的RTF文本另外,兄弟从一个鬼子的网站上看到有段这样的程序
CString CRichText::GetSelRTF()
{
CString result;
InvokeHelper(0xb, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL);
return result;
}该函数确实能够实现我所需要的功能,但是,因为兄弟的程序将来要移植到其他语言中,所以不能用InvokeHelper函数,不知是否有其他的办法能够实现先谢过了

解决方案 »

  1.   

    InvokeHelper本来就很利于多语言转化啊,有什么问题啊
      

  2.   

    Microsoft Foundation Class Library for Windows CE   
    CWnd::InvokeHelperThis method invokes the ActiveX control method or property specified by dwDispID, in the context specified by wFlags. The pbParamInfo parameter specifies the types of the parameters passed to the method or property. The variable list of arguments is represented by ... in the syntax declaration.void AFX_CDECL InvokeHelper( 
    DISPID dwDispID, 
    WORD wFlags, 
    VARTYPE vtRet, 
    void* pvRet, 
    const BYTE* pbParamInfo, ... ); 
    Parameters dwDispID 
    Identifies the method or property to be invoked. This value is usually supplied by Component Gallery. 
    wFlags 
    Flags describing the context of the call to IDispatch::Invoke. For possible wFlags values, see IDispatch::Invoke. 
    vtRet 
    Specifies the type of the return value. For possible values, see the Res section for
      

  3.   

    先谢谢诸位老大的帮助
    但兄弟要移植的目标语言是PowerBuilder,真的不知道该咋调用这个InvokeHelper
    如果大侠有办法,还望能够给兄弟指点一二,多谢
      

  4.   

    对不起,刚才又仔细看了看,用Invoke函数的那个程序调用的是RichText OCX控件,而不是CRichEditControl
    看来现在没必要再研究这个Invoke了,而只能寻找获取RichEdit中选中内容的RTF信息的办法了大侠们帮忙啊,先谢谢了