Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用TSF从华宇拼音输入法获取候选词的时候,获取不到拼音分割词 #7

Open
lopengye opened this issue Aug 13, 2021 · 0 comments

Comments

@lopengye
Copy link

while (enumCompositionView.Next(1, compositionView, out fetchCount) && fetchCount > 0)
{
ITfRange range;
result = compositionView[0].GetRange(out range);
if (result)
{
var text = new char[256];
var writeCount = 0U;
//bool isEmpty;
//range.IsEmpty(ecReadOnly, out isEmpty);
range.GetText(ecReadOnly, TF_TF.TF_TF_MOVESTART, text, 255, out writeCount);
var tempStr = new string(text).Trim('\0');
resultStr += tempStr;
System.Diagnostics.Debug.WriteLine($"{tempStr}");
//OnTextOutput?.Invoke(tempStr);
//Debug.WriteLine("resultStr={0}, tempStr={1}", resultStr, tempStr);
}

                Marshal.ReleaseComObject(compositionView[0]);
            }

range.GetText(ecReadOnly, TF_TF.TF_TF_MOVESTART, text, 255, out writeCount);
这一句永远返回空字符串,求解

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant