WEB开发网
开发学院软件开发VC VC++动态链接库(DLL)编程深入浅出(四) 阅读

VC++动态链接库(DLL)编程深入浅出(四)

 2007-03-15 21:48:07 来源:WEB开发网   
核心提示: #ifndef _SXBUTTON_H#define _SXBUTTON_H#defineSXBUTTON_CENTER-1class AFX_EXT_CLASS CSXButton : public CButton{// Constructionpublic:CSXButton();//
#ifndef _SXBUTTON_H
#define _SXBUTTON_H
#defineSXBUTTON_CENTER-1
class AFX_EXT_CLASS CSXButton : public CButton
{
// Construction
public:
CSXButton();
// Attributes
private:
//Positioning
BOOL m_bUseOffset;  
CPoint m_pointImage;
CPoint m_pointText;
int m_nImageOffsetFromBorder;
int m_nTextOffsetFromImage;
//Image
HICON m_hIcon;  
HBITMAP m_hBitmap;
HBITMAP m_hBitmapDisabled;
int m_nImageWidth, m_nImageHeight;
//Color Tab
char m_bColorTab;  
COLORREFm_crColorTab;
//State
BOOL m_bDefault;
UINT m_nOldAction;
UINT m_nOldState;
// Operations
public:
//Positioning
int SetImageOffset( int nPixels );
int SetTextOffset( int nPixels );
CPointSetImagePos( CPoint p );
CPointSetTextPos( CPoint p );
//Image
BOOLSetIcon( UINT nID, int nWidth, int nHeight );
BOOLSetBitmap( UINT nID, int nWidth, int nHeight );
BOOLSetMaskedBitmap( UINT nID, int nWidth, int nHeight, COLORREF crTransparentMask );
BOOLHasImage() { return (BOOL)( m_hIcon != 0 | m_hBitmap != 0 ); }
//Color Tab
voidSetColorTab(COLORREF crTab);
//State
BOOLSetDefaultButton( BOOL bState = TRUE );
private:
BOOLSetBitmapCommon( UINT nID, int nWidth, int nHeight, COLORREF crTransparentMask, BOOL bUseMask );
voidCheckPointForCentering( CPoint &p, int nWidth, int nHeight );
voidRedraw();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CSXButton)
public:
virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CSXButton();
// Generated message map functions
protected:
//{{AFX_MSG(CSXButton)
afx_msg LRESULT OnGetText(WPARAM wParam, LPARAM lParam);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#endif

把SXBUTTON.CPP文件直接添加到工程,编译工程,得到“mfcexpenddll.lib”和“mfcexpenddll.dll”两个文件。我们用Visual Studio自带的Depends工具可以查看这个.dll,发现其导出了众多符号(见图15)。

上一页  1 2 3 4  下一页

Tags:VC 动态 链接

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接