www.mxdraw.com
内容索引主面
前一个向上下一个
_DMxDrawX::GetMTextContent 方法

返回多行文字,的文字内容。

IDL
[id(184), helpstring("method GetMTextContent")]
BSTR GetMTextContent(LONGLONG lId);

例如: 实现代码

                BSTR CMxDrawXCtrl::GetMTextContent(LONGLONG lId)
                {
                    AFX_MANAGE_STATE(AfxGetStaticModuleState());

                    CString strResult;

                    McDbObjectId id;
                    id.setFromOldId(lId);

                    McDbObjectPointer<McDbMText> spMText(id,McDb::kForRead);
                    if(spMText.openStatus() != Mcad::eOk)
                        return strResult.AllocSysString();

                    McDbVoidPtrArray entitySet;
                    spMText->explode(entitySet);

                    for(int i = 0; i < entitySet.length();i++)
                    {
                        McDbObject* pObj = (McDbObject*)entitySet[i];
                        if(pObj== NULL)
                        {
                            MXASSERT(0);
                            continue;
                        }

                        McDbText* pText = McDbText::cast(pObj);
                        if(pText != NULL)
                        {
                            CString sVal = pText->textStringConst();
                            if(strResult.IsEmpty())
                            {
                                strResult = sVal;
                            }
                            else
                            {
                                CString sTmp;
                                sTmp.Format(_T("%s%s"),strResult,sVal);
                                strResult = sTmp;
                            }
                        }

                        delete pObj;
                    }
                    return strResult.AllocSysString();
                }
Copyright (c) 2010. All rights reserved.
你认为该帮助怎么样? 发送反馈信息!