I want to insert some characters after insertion,but the text inserted is before insertion.
the code segment :
......//ignore some codes and definitioans
ITfContext *pContext=GetContext();//GetContext is custom-function.
ITfRange* range(NULL);
wchar_t *pTxBuf=m_ImeData->TxBuffer;
hr=pContext->GetSelection(ec,TF_DEFAULT_SELECTION,1,&ts,&nSels);
if( SUCCEEDED(hr) )
{
range=ts.range;
TF_SELECTION ts={0};
ULONG nSels(0);
ULONG len=wcslen(pTxBuf);
LONG n(0);
hr=range->SetGravity(ec,TF_GRAVITY_FORWARD,TF_GRAVITY_FORWARD);
hr=range->SetText(ec,TF_ST_CORRECTION,pTxBuf,len);
}...