Windows/MFC

dll 생성 AFX_EXT_CLASS

aucd29 2013. 10. 2. 18:07
dll 생성하기 가장 쉽게 하는 방법 AFX_EXT_CLASS를 붙이는 것 하지만 MFC에서만 사용할 수 있는 dll 이 된다.

class AFX_EXT_CLASS CModArt : public CObject
{
public:
//    static const COLORREF m_crColors[8];
    void NewDrawing();
    virtual void Serialize(CArchive &ar);
    void Draw(CDC *pDC);
    void ClearDrawing();
    void SetRect(CRect rDrawArea);
    CModArt();
    virtual ~CModArt();

private:
    void NewLine();
    UINT m_nColor;
    UINT m_nWidth;
    CRect m_rDrawArea;
    CObArray m_oaLines;
};


1. externsion dll project를 만든다.
2. 만든 곳에 원하는 class를 생성하고 AFX_EXT_CLASS 를 기입한다.
3. 빌드
4. 사용 #pragma comment(lib, "name.lib")