int CTxtView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CView::OnCreate(lpCreateStruct) == -1)
return -1;
CClientDC dc(this);
TEXTMETRIC tm;
dc.GetTextMetrics(&tm);
CreateSolidCaret(tm.tmAveCharWidth/8,tm.tmHeight); //创建光标,记得tm.tmAveCharWidth/8 这个宽度比较合适
// TODO: Add your specialized creation code here
ShowCaret();//显示光标,没有这个,可能就显示不出来,真麻烦
return 0;
}