ObjectARX, AutoCAD. Среда программирования библиотеки C++



Добавьте Код, чтобы Поддержать Новый Объект COM ATL - часть 4


void CAsdkDcContent::OpenAndDisplayTextFile()

{

DWORD length;

CString cstrBuff = OpenAndReadTextFile(length);

BSTR bstrBuf = cstrBuff.AllocSysString();

m_pBrowser->SetItemDescription(bstrBuf);

::SysFreeString(bstrBuf);

}

 

STDMETHODIMP CAsdkDcContent::PaletteItemClick(BSTR bstrItemText)

{

USES_CONVERSION;

m_strSelectedItemText = OLE2T(bstrItemText);

OpenAndDisplayTextFile();

return S_OK;

}

 

void CAsdkDcContent::OpenAndInsertTextFile()

{

DWORD length;

CString cstrBuff = OpenAndReadTextFile(length);

cstrBuff.Replace("\015\012", "\\P");

struct resbuf resbufViewCtr;

resbufViewCtr.restype = RT3DPOINT;

acedGetVar("VIEWCTR", &resbufViewCtr);

AcGePoint3d pt(resbufViewCtr.resval.rpoint[X],

resbufViewCtr.resval.rpoint[Y],

resbufViewCtr.resval.rpoint[Z]);

AcDbMText *pMText = new AcDbMText();

pMText->setLocation(pt);

pMText->setContents(cstrBuff);

append(pMText);

pMText->downgradeOpen();

pMText->draw();

pMText->close();

}

 

STDMETHODIMP CAsdkDcContent::PaletteItemDblClick(

BSTR bstrItemText)

{

USES_CONVERSION;

m_strSelectedItemText = OLE2T(bstrItemText);

OpenAndInsertTextFile();

return S_OK;

}

 

STDMETHODIMP CAsdkDcContent::PaletteColumnClick(

VARIANT varIndex)

{

return S_OK;

}

 

STDMETHODIMP CAsdkDcContent::PaletteMouseUp(

VARIANT varButton,

VARIANT varItemTexts,

VARIANT varX,

VARIANT varY)

{

return S_OK;

}

 

STDMETHODIMP CAsdkDcContent::PaletteMouseDown(

VARIANT varButton,

BSTR bstrFullText,

VARIANT varX, VARIANT varY)

{

return S_OK;

}

 

STDMETHODIMP CAsdkDcContent::RenderPreviewWindow(

BSTR bstrFullText,

VARIANT varhPreviewWindow)

{

return S_OK;

}

 

STDMETHODIMP CAsdkDcContent::PreviewMouseUp(

VARIANT varButton,

VARIANT varX,

VARIANT varY)

{

return S_OK;

}

 

STDMETHODIMP CAsdkDcContent::Refresh()

{

return S_OK;

}

 

STDMETHODIMP CAsdkDcContent::PaletteBeginDrag(

VARIANT varItemTexts,

VARIANT varX,




Содержание  Назад  Вперед