NTGRAPH控件中的BUG

时间:2021-12-29 18:33:11
各位大神有没有使用过NTGRAPH控件的,我使用ZOOM时,第一下鼠标左键按下移动可以出现虚线方框,但第二下就不行,要再点一下才可以用,我看了下源码,调用的是
void CNTGraphCtrl::DoZoom(UINT nFlags, CPoint point) 
{
if (m_nTrackMode==Zoom) 
{
if (bUnzoom) 
{
dOldRangeX[MIN]=dRangeX[MIN];
dOldRangeY[MIN]=dRangeY[MIN];
dOldRangeX[MAX]=dRangeX[MAX];
dOldRangeY[MAX]=dRangeY[MAX];
bUnzoom = FALSE;
}
         
CRectTracker tracker;
double xmin, xmax, ymin, ymax;
        xmin=dRangeX[MIN];
        xmin=dRangeX[MAX];
ymin=dRangeY[MIN];
ymax=dRangeY[MAX];

if (tracker.TrackRubberBand(this, point) )
{
CPoint pt1, pt2;

tracker.m_rect.NormalizeRect ();
pt1= tracker.m_rect.TopLeft ();
pt2= tracker.m_rect.BottomRight ();

xmin = PT2DBLX(pt1.x);
ymax = PT2DBLY(pt1.y);
xmax = PT2DBLX(pt2.x);
ymin = PT2DBLY(pt2.y);

}
        
SetRange(xmin,xmax,ymin,ymax);

// Don't ask me why!
//CClientDC dc(this); 
//SendMessage(WM_LBUTTONUP, (WPARAM) dc.GetSafeHdc(), 0);
//COleControl::OnLButtonUp(nFlags, point);
    }
}

我第二下左键点下if (tracker.TrackRubberBand(this, point) ) 返回值为非,各位大神帮忙解决下这个BUG,非常感谢

10 个解决方案

#1


自己顶一下,大神们来帮帮忙呀

#2


ZOOM,什么版本的NTGRAPH,我用的没有

#3


引用 2 楼 wjm1990 的回复:
ZOOM,什么版本的NTGRAPH,我用的没有
 我是codeproject这个上面下载的,哥们 能不能把你的NTGRAPH源码发我看看

#4


ZOOM主要做什么用

#5


引用 4 楼 wjm1990 的回复:
ZOOM主要做什么用
缩放功能,你没用过这个?

#6


引用 5 楼 qzroger 的回复:
Quote: 引用 4 楼 wjm1990 的回复:

ZOOM主要做什么用
缩放功能,你没用过这个?

我直接通过鼠标点击消息获取起点,终点然后SetRange

#7


引用 6 楼 wjm1990 的回复:
Quote: 引用 5 楼 qzroger 的回复:

Quote: 引用 4 楼 wjm1990 的回复:

ZOOM主要做什么用
缩放功能,你没用过这个?

我直接通过鼠标点击消息获取起点,终点然后SetRange
你是自己实现这个功能的?NTGRAPH有带这个缩放功能吧

#8


引用 6 楼 wjm1990 的回复:
Quote: 引用 5 楼 qzroger 的回复:

Quote: 引用 4 楼 wjm1990 的回复:

ZOOM主要做什么用
缩放功能,你没用过这个?

我直接通过鼠标点击消息获取起点,终点然后SetRange
那你鼠标点击会出现虚线框吗

#9


#if !defined(AFX_NTGRAPH_H__DD0B623C_C9D1_49B8_8512_A2D69335842D__INCLUDED_)
#define AFX_NTGRAPH_H__DD0B623C_C9D1_49B8_8512_A2D69335842D__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// Machine generated IDispatch wrapper class(es) created by Microsoft Visual C++

// NOTE: Do not modify the contents of this file.  If this class is regenerated by
//  Microsoft Visual C++, your modifications will be overwritten.


// Dispatch interfaces referenced by this interface
class COleFont;
class CPicture;

/////////////////////////////////////////////////////////////////////////////
// CNTGraph wrapper class

class CNTGraph : public CWnd
{
protected:
DECLARE_DYNCREATE(CNTGraph)
public:
CLSID const& GetClsid()
{
static CLSID const clsid
= { 0xc9fe01c2, 0x2746, 0x479b, { 0x96, 0xab, 0xe0, 0xbe, 0x99, 0x31, 0xb0, 0x18 } };
return clsid;
}
virtual BOOL Create(LPCTSTR lpszClassName,
LPCTSTR lpszWindowName, DWORD dwStyle,
const RECT& rect,
CWnd* pParentWnd, UINT nID,
CCreateContext* pContext = NULL)
{ return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID); }

    BOOL Create(LPCTSTR lpszWindowName, DWORD dwStyle,
const RECT& rect, CWnd* pParentWnd, UINT nID,
CFile* pPersist = NULL, BOOL bStorage = FALSE,
BSTR bstrLicKey = NULL)
{ return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID,
pPersist, bStorage, bstrLicKey); }

// Attributes
public:
short GetAppearance();
void SetAppearance(short);
CString GetCaption();
void SetCaption(LPCTSTR);
BOOL GetEnabled();
void SetEnabled(BOOL);
unsigned long GetAxisColor();
void SetAxisColor(unsigned long);
unsigned long GetGridColor();
void SetGridColor(unsigned long);
unsigned long GetLabelColor();
void SetLabelColor(unsigned long);
unsigned long GetCursorColor();
void SetCursorColor(unsigned long);
COleFont GetLabelFont();
void SetLabelFont(LPDISPATCH);
COleFont GetTickFont();
void SetTickFont(LPDISPATCH);
COleFont GetTitleFont();
void SetTitleFont(LPDISPATCH);
COleFont GetIdentFont();
void SetIdentFont(LPDISPATCH);
short GetXGridNumber();
void SetXGridNumber(short);
short GetYGridNumber();
void SetYGridNumber(short);
BOOL GetShowGrid();
void SetShowGrid(BOOL);
CString GetXLabel();
void SetXLabel(LPCTSTR);
CString GetYLabel();
void SetYLabel(LPCTSTR);
unsigned long GetElementLineColor();
void SetElementLineColor(unsigned long);
unsigned long GetElementPointColor();
void SetElementPointColor(unsigned long);
long GetElementLinetype();
void SetElementLinetype(long);
long GetElementWidth();
void SetElementWidth(long);
long GetElementPointSymbol();
void SetElementPointSymbol(long);
BOOL GetElementSolidPoint();
void SetElementSolidPoint(BOOL);
BOOL GetElementShow();
void SetElementShow(BOOL);
long GetTrackMode();
void SetTrackMode(long);
CString GetElementName();
void SetElementName(LPCTSTR);
BOOL GetElementIdentify();
void SetElementIdentify(BOOL);
BOOL GetXLog();
void SetXLog(BOOL);
BOOL GetYLog();
void SetYLog(BOOL);
CPicture GetControlFramePicture();
void SetControlFramePicture(LPDISPATCH);
CPicture GetPlotAreaPicture();
void SetPlotAreaPicture(LPDISPATCH);
unsigned long GetControlFrameColor();
void SetControlFrameColor(unsigned long);
unsigned long GetPlotAreaColor();
void SetPlotAreaColor(unsigned long);
long GetFrameStyle();
void SetFrameStyle(long);
CString GetAnnoLabelCaption();
void SetAnnoLabelCaption(LPCTSTR);
double GetAnnoLabelX();
void SetAnnoLabelX(double);
double GetAnnoLabelY();
void SetAnnoLabelY(double);
unsigned long GetAnnoLabelColor();
void SetAnnoLabelColor(unsigned long);
BOOL GetAnnoLabelHorizontal();
void SetAnnoLabelHorizontal(BOOL);
short GetAnnotation();
void SetAnnotation(short);
BOOL GetAnnoVisible();
void SetAnnoVisible(BOOL);
short GetAnnoCount();
void SetAnnoCount(short);
short GetElement();
void SetElement(short);
short GetElementCount();
void SetElementCount(short);
unsigned long GetAnnoLabelBkColor();
void SetAnnoLabelBkColor(unsigned long);
short GetCursorCount();
void SetCursorCount(short);
short GetCursor();
void SetCursor(short);
double GetCursorX();
void SetCursorX(double);
double GetCursorY();
void SetCursorY(double);
short GetCursorStyle();
void SetCursorStyle(short);
BOOL GetCursorVisible();
void SetCursorVisible(BOOL);
short GetCursorMode();
void SetCursorMode(short);
CString GetFormatAxisBottom();
void SetFormatAxisBottom(LPCTSTR);
CString GetFormatAxisLeft();
void SetFormatAxisLeft(LPCTSTR);
BOOL GetYTime();
void SetYTime(BOOL);
BOOL GetXTime();
void SetXTime(BOOL);

// Operations
public:
void SetRange(double xmin, double xmax, double ymin, double ymax);
void AutoRange();
void CopyToClipboard();
void PrintGraph();
void AddElement();
void DeleteElement(short ElementID);
void ClearGraph();
double GetElementXValue(long index, short ElementID);
void SetElementXValue(long index, short ElementID, double newValue);
double GetElementYValue(long index, short ElementID);
void SetElementYValue(long index, short ElementID, double newValue);
void PlotXY(double X, double Y, short ElementID);
void PlotY(double Y, short ElementID);
void ShowProperties();
void SaveAs(LPCTSTR szFilename);
void AddAnnotation();
void DeleteAnnotation(short annoID);
void AddCursor();
void DeleteCursor(short cursorID);
void AboutBox();
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_NTGRAPH_H__DD0B623C_C9D1_49B8_8512_A2D69335842D__INCLUDED_)
没有你那个函数,所以只能自己画,还好用

#10


引用 9 楼 wjm1990 的回复:
#if !defined(AFX_NTGRAPH_H__DD0B623C_C9D1_49B8_8512_A2D69335842D__INCLUDED_)
#define AFX_NTGRAPH_H__DD0B623C_C9D1_49B8_8512_A2D69335842D__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// Machine generated IDispatch wrapper class(es) created by Microsoft Visual C++

// NOTE: Do not modify the contents of this file.  If this class is regenerated by
//  Microsoft Visual C++, your modifications will be overwritten.


// Dispatch interfaces referenced by this interface
class COleFont;
class CPicture;

/////////////////////////////////////////////////////////////////////////////
// CNTGraph wrapper class

class CNTGraph : public CWnd
{
protected:
DECLARE_DYNCREATE(CNTGraph)
public:
CLSID const& GetClsid()
{
static CLSID const clsid
= { 0xc9fe01c2, 0x2746, 0x479b, { 0x96, 0xab, 0xe0, 0xbe, 0x99, 0x31, 0xb0, 0x18 } };
return clsid;
}
virtual BOOL Create(LPCTSTR lpszClassName,
LPCTSTR lpszWindowName, DWORD dwStyle,
const RECT& rect,
CWnd* pParentWnd, UINT nID,
CCreateContext* pContext = NULL)
{ return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID); }

    BOOL Create(LPCTSTR lpszWindowName, DWORD dwStyle,
const RECT& rect, CWnd* pParentWnd, UINT nID,
CFile* pPersist = NULL, BOOL bStorage = FALSE,
BSTR bstrLicKey = NULL)
{ return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID,
pPersist, bStorage, bstrLicKey); }

// Attributes
public:
short GetAppearance();
void SetAppearance(short);
CString GetCaption();
void SetCaption(LPCTSTR);
BOOL GetEnabled();
void SetEnabled(BOOL);
unsigned long GetAxisColor();
void SetAxisColor(unsigned long);
unsigned long GetGridColor();
void SetGridColor(unsigned long);
unsigned long GetLabelColor();
void SetLabelColor(unsigned long);
unsigned long GetCursorColor();
void SetCursorColor(unsigned long);
COleFont GetLabelFont();
void SetLabelFont(LPDISPATCH);
COleFont GetTickFont();
void SetTickFont(LPDISPATCH);
COleFont GetTitleFont();
void SetTitleFont(LPDISPATCH);
COleFont GetIdentFont();
void SetIdentFont(LPDISPATCH);
short GetXGridNumber();
void SetXGridNumber(short);
short GetYGridNumber();
void SetYGridNumber(short);
BOOL GetShowGrid();
void SetShowGrid(BOOL);
CString GetXLabel();
void SetXLabel(LPCTSTR);
CString GetYLabel();
void SetYLabel(LPCTSTR);
unsigned long GetElementLineColor();
void SetElementLineColor(unsigned long);
unsigned long GetElementPointColor();
void SetElementPointColor(unsigned long);
long GetElementLinetype();
void SetElementLinetype(long);
long GetElementWidth();
void SetElementWidth(long);
long GetElementPointSymbol();
void SetElementPointSymbol(long);
BOOL GetElementSolidPoint();
void SetElementSolidPoint(BOOL);
BOOL GetElementShow();
void SetElementShow(BOOL);
long GetTrackMode();
void SetTrackMode(long);
CString GetElementName();
void SetElementName(LPCTSTR);
BOOL GetElementIdentify();
void SetElementIdentify(BOOL);
BOOL GetXLog();
void SetXLog(BOOL);
BOOL GetYLog();
void SetYLog(BOOL);
CPicture GetControlFramePicture();
void SetControlFramePicture(LPDISPATCH);
CPicture GetPlotAreaPicture();
void SetPlotAreaPicture(LPDISPATCH);
unsigned long GetControlFrameColor();
void SetControlFrameColor(unsigned long);
unsigned long GetPlotAreaColor();
void SetPlotAreaColor(unsigned long);
long GetFrameStyle();
void SetFrameStyle(long);
CString GetAnnoLabelCaption();
void SetAnnoLabelCaption(LPCTSTR);
double GetAnnoLabelX();
void SetAnnoLabelX(double);
double GetAnnoLabelY();
void SetAnnoLabelY(double);
unsigned long GetAnnoLabelColor();
void SetAnnoLabelColor(unsigned long);
BOOL GetAnnoLabelHorizontal();
void SetAnnoLabelHorizontal(BOOL);
short GetAnnotation();
void SetAnnotation(short);
BOOL GetAnnoVisible();
void SetAnnoVisible(BOOL);
short GetAnnoCount();
void SetAnnoCount(short);
short GetElement();
void SetElement(short);
short GetElementCount();
void SetElementCount(short);
unsigned long GetAnnoLabelBkColor();
void SetAnnoLabelBkColor(unsigned long);
short GetCursorCount();
void SetCursorCount(short);
short GetCursor();
void SetCursor(short);
double GetCursorX();
void SetCursorX(double);
double GetCursorY();
void SetCursorY(double);
short GetCursorStyle();
void SetCursorStyle(short);
BOOL GetCursorVisible();
void SetCursorVisible(BOOL);
short GetCursorMode();
void SetCursorMode(short);
CString GetFormatAxisBottom();
void SetFormatAxisBottom(LPCTSTR);
CString GetFormatAxisLeft();
void SetFormatAxisLeft(LPCTSTR);
BOOL GetYTime();
void SetYTime(BOOL);
BOOL GetXTime();
void SetXTime(BOOL);

// Operations
public:
void SetRange(double xmin, double xmax, double ymin, double ymax);
void AutoRange();
void CopyToClipboard();
void PrintGraph();
void AddElement();
void DeleteElement(short ElementID);
void ClearGraph();
double GetElementXValue(long index, short ElementID);
void SetElementXValue(long index, short ElementID, double newValue);
double GetElementYValue(long index, short ElementID);
void SetElementYValue(long index, short ElementID, double newValue);
void PlotXY(double X, double Y, short ElementID);
void PlotY(double Y, short ElementID);
void ShowProperties();
void SaveAs(LPCTSTR szFilename);
void AddAnnotation();
void DeleteAnnotation(short annoID);
void AddCursor();
void DeleteCursor(short cursorID);
void AboutBox();
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_NTGRAPH_H__DD0B623C_C9D1_49B8_8512_A2D69335842D__INCLUDED_)
没有你那个函数,所以只能自己画,还好用
DoZoom这个是在源码的鼠标左键按下那个里面的,你有改过源码吗

#1


自己顶一下,大神们来帮帮忙呀

#2


ZOOM,什么版本的NTGRAPH,我用的没有

#3


引用 2 楼 wjm1990 的回复:
ZOOM,什么版本的NTGRAPH,我用的没有
 我是codeproject这个上面下载的,哥们 能不能把你的NTGRAPH源码发我看看

#4


ZOOM主要做什么用

#5


引用 4 楼 wjm1990 的回复:
ZOOM主要做什么用
缩放功能,你没用过这个?

#6


引用 5 楼 qzroger 的回复:
Quote: 引用 4 楼 wjm1990 的回复:

ZOOM主要做什么用
缩放功能,你没用过这个?

我直接通过鼠标点击消息获取起点,终点然后SetRange

#7


引用 6 楼 wjm1990 的回复:
Quote: 引用 5 楼 qzroger 的回复:

Quote: 引用 4 楼 wjm1990 的回复:

ZOOM主要做什么用
缩放功能,你没用过这个?

我直接通过鼠标点击消息获取起点,终点然后SetRange
你是自己实现这个功能的?NTGRAPH有带这个缩放功能吧

#8


引用 6 楼 wjm1990 的回复:
Quote: 引用 5 楼 qzroger 的回复:

Quote: 引用 4 楼 wjm1990 的回复:

ZOOM主要做什么用
缩放功能,你没用过这个?

我直接通过鼠标点击消息获取起点,终点然后SetRange
那你鼠标点击会出现虚线框吗

#9


#if !defined(AFX_NTGRAPH_H__DD0B623C_C9D1_49B8_8512_A2D69335842D__INCLUDED_)
#define AFX_NTGRAPH_H__DD0B623C_C9D1_49B8_8512_A2D69335842D__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// Machine generated IDispatch wrapper class(es) created by Microsoft Visual C++

// NOTE: Do not modify the contents of this file.  If this class is regenerated by
//  Microsoft Visual C++, your modifications will be overwritten.


// Dispatch interfaces referenced by this interface
class COleFont;
class CPicture;

/////////////////////////////////////////////////////////////////////////////
// CNTGraph wrapper class

class CNTGraph : public CWnd
{
protected:
DECLARE_DYNCREATE(CNTGraph)
public:
CLSID const& GetClsid()
{
static CLSID const clsid
= { 0xc9fe01c2, 0x2746, 0x479b, { 0x96, 0xab, 0xe0, 0xbe, 0x99, 0x31, 0xb0, 0x18 } };
return clsid;
}
virtual BOOL Create(LPCTSTR lpszClassName,
LPCTSTR lpszWindowName, DWORD dwStyle,
const RECT& rect,
CWnd* pParentWnd, UINT nID,
CCreateContext* pContext = NULL)
{ return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID); }

    BOOL Create(LPCTSTR lpszWindowName, DWORD dwStyle,
const RECT& rect, CWnd* pParentWnd, UINT nID,
CFile* pPersist = NULL, BOOL bStorage = FALSE,
BSTR bstrLicKey = NULL)
{ return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID,
pPersist, bStorage, bstrLicKey); }

// Attributes
public:
short GetAppearance();
void SetAppearance(short);
CString GetCaption();
void SetCaption(LPCTSTR);
BOOL GetEnabled();
void SetEnabled(BOOL);
unsigned long GetAxisColor();
void SetAxisColor(unsigned long);
unsigned long GetGridColor();
void SetGridColor(unsigned long);
unsigned long GetLabelColor();
void SetLabelColor(unsigned long);
unsigned long GetCursorColor();
void SetCursorColor(unsigned long);
COleFont GetLabelFont();
void SetLabelFont(LPDISPATCH);
COleFont GetTickFont();
void SetTickFont(LPDISPATCH);
COleFont GetTitleFont();
void SetTitleFont(LPDISPATCH);
COleFont GetIdentFont();
void SetIdentFont(LPDISPATCH);
short GetXGridNumber();
void SetXGridNumber(short);
short GetYGridNumber();
void SetYGridNumber(short);
BOOL GetShowGrid();
void SetShowGrid(BOOL);
CString GetXLabel();
void SetXLabel(LPCTSTR);
CString GetYLabel();
void SetYLabel(LPCTSTR);
unsigned long GetElementLineColor();
void SetElementLineColor(unsigned long);
unsigned long GetElementPointColor();
void SetElementPointColor(unsigned long);
long GetElementLinetype();
void SetElementLinetype(long);
long GetElementWidth();
void SetElementWidth(long);
long GetElementPointSymbol();
void SetElementPointSymbol(long);
BOOL GetElementSolidPoint();
void SetElementSolidPoint(BOOL);
BOOL GetElementShow();
void SetElementShow(BOOL);
long GetTrackMode();
void SetTrackMode(long);
CString GetElementName();
void SetElementName(LPCTSTR);
BOOL GetElementIdentify();
void SetElementIdentify(BOOL);
BOOL GetXLog();
void SetXLog(BOOL);
BOOL GetYLog();
void SetYLog(BOOL);
CPicture GetControlFramePicture();
void SetControlFramePicture(LPDISPATCH);
CPicture GetPlotAreaPicture();
void SetPlotAreaPicture(LPDISPATCH);
unsigned long GetControlFrameColor();
void SetControlFrameColor(unsigned long);
unsigned long GetPlotAreaColor();
void SetPlotAreaColor(unsigned long);
long GetFrameStyle();
void SetFrameStyle(long);
CString GetAnnoLabelCaption();
void SetAnnoLabelCaption(LPCTSTR);
double GetAnnoLabelX();
void SetAnnoLabelX(double);
double GetAnnoLabelY();
void SetAnnoLabelY(double);
unsigned long GetAnnoLabelColor();
void SetAnnoLabelColor(unsigned long);
BOOL GetAnnoLabelHorizontal();
void SetAnnoLabelHorizontal(BOOL);
short GetAnnotation();
void SetAnnotation(short);
BOOL GetAnnoVisible();
void SetAnnoVisible(BOOL);
short GetAnnoCount();
void SetAnnoCount(short);
short GetElement();
void SetElement(short);
short GetElementCount();
void SetElementCount(short);
unsigned long GetAnnoLabelBkColor();
void SetAnnoLabelBkColor(unsigned long);
short GetCursorCount();
void SetCursorCount(short);
short GetCursor();
void SetCursor(short);
double GetCursorX();
void SetCursorX(double);
double GetCursorY();
void SetCursorY(double);
short GetCursorStyle();
void SetCursorStyle(short);
BOOL GetCursorVisible();
void SetCursorVisible(BOOL);
short GetCursorMode();
void SetCursorMode(short);
CString GetFormatAxisBottom();
void SetFormatAxisBottom(LPCTSTR);
CString GetFormatAxisLeft();
void SetFormatAxisLeft(LPCTSTR);
BOOL GetYTime();
void SetYTime(BOOL);
BOOL GetXTime();
void SetXTime(BOOL);

// Operations
public:
void SetRange(double xmin, double xmax, double ymin, double ymax);
void AutoRange();
void CopyToClipboard();
void PrintGraph();
void AddElement();
void DeleteElement(short ElementID);
void ClearGraph();
double GetElementXValue(long index, short ElementID);
void SetElementXValue(long index, short ElementID, double newValue);
double GetElementYValue(long index, short ElementID);
void SetElementYValue(long index, short ElementID, double newValue);
void PlotXY(double X, double Y, short ElementID);
void PlotY(double Y, short ElementID);
void ShowProperties();
void SaveAs(LPCTSTR szFilename);
void AddAnnotation();
void DeleteAnnotation(short annoID);
void AddCursor();
void DeleteCursor(short cursorID);
void AboutBox();
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_NTGRAPH_H__DD0B623C_C9D1_49B8_8512_A2D69335842D__INCLUDED_)
没有你那个函数,所以只能自己画,还好用

#10


引用 9 楼 wjm1990 的回复:
#if !defined(AFX_NTGRAPH_H__DD0B623C_C9D1_49B8_8512_A2D69335842D__INCLUDED_)
#define AFX_NTGRAPH_H__DD0B623C_C9D1_49B8_8512_A2D69335842D__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// Machine generated IDispatch wrapper class(es) created by Microsoft Visual C++

// NOTE: Do not modify the contents of this file.  If this class is regenerated by
//  Microsoft Visual C++, your modifications will be overwritten.


// Dispatch interfaces referenced by this interface
class COleFont;
class CPicture;

/////////////////////////////////////////////////////////////////////////////
// CNTGraph wrapper class

class CNTGraph : public CWnd
{
protected:
DECLARE_DYNCREATE(CNTGraph)
public:
CLSID const& GetClsid()
{
static CLSID const clsid
= { 0xc9fe01c2, 0x2746, 0x479b, { 0x96, 0xab, 0xe0, 0xbe, 0x99, 0x31, 0xb0, 0x18 } };
return clsid;
}
virtual BOOL Create(LPCTSTR lpszClassName,
LPCTSTR lpszWindowName, DWORD dwStyle,
const RECT& rect,
CWnd* pParentWnd, UINT nID,
CCreateContext* pContext = NULL)
{ return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID); }

    BOOL Create(LPCTSTR lpszWindowName, DWORD dwStyle,
const RECT& rect, CWnd* pParentWnd, UINT nID,
CFile* pPersist = NULL, BOOL bStorage = FALSE,
BSTR bstrLicKey = NULL)
{ return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID,
pPersist, bStorage, bstrLicKey); }

// Attributes
public:
short GetAppearance();
void SetAppearance(short);
CString GetCaption();
void SetCaption(LPCTSTR);
BOOL GetEnabled();
void SetEnabled(BOOL);
unsigned long GetAxisColor();
void SetAxisColor(unsigned long);
unsigned long GetGridColor();
void SetGridColor(unsigned long);
unsigned long GetLabelColor();
void SetLabelColor(unsigned long);
unsigned long GetCursorColor();
void SetCursorColor(unsigned long);
COleFont GetLabelFont();
void SetLabelFont(LPDISPATCH);
COleFont GetTickFont();
void SetTickFont(LPDISPATCH);
COleFont GetTitleFont();
void SetTitleFont(LPDISPATCH);
COleFont GetIdentFont();
void SetIdentFont(LPDISPATCH);
short GetXGridNumber();
void SetXGridNumber(short);
short GetYGridNumber();
void SetYGridNumber(short);
BOOL GetShowGrid();
void SetShowGrid(BOOL);
CString GetXLabel();
void SetXLabel(LPCTSTR);
CString GetYLabel();
void SetYLabel(LPCTSTR);
unsigned long GetElementLineColor();
void SetElementLineColor(unsigned long);
unsigned long GetElementPointColor();
void SetElementPointColor(unsigned long);
long GetElementLinetype();
void SetElementLinetype(long);
long GetElementWidth();
void SetElementWidth(long);
long GetElementPointSymbol();
void SetElementPointSymbol(long);
BOOL GetElementSolidPoint();
void SetElementSolidPoint(BOOL);
BOOL GetElementShow();
void SetElementShow(BOOL);
long GetTrackMode();
void SetTrackMode(long);
CString GetElementName();
void SetElementName(LPCTSTR);
BOOL GetElementIdentify();
void SetElementIdentify(BOOL);
BOOL GetXLog();
void SetXLog(BOOL);
BOOL GetYLog();
void SetYLog(BOOL);
CPicture GetControlFramePicture();
void SetControlFramePicture(LPDISPATCH);
CPicture GetPlotAreaPicture();
void SetPlotAreaPicture(LPDISPATCH);
unsigned long GetControlFrameColor();
void SetControlFrameColor(unsigned long);
unsigned long GetPlotAreaColor();
void SetPlotAreaColor(unsigned long);
long GetFrameStyle();
void SetFrameStyle(long);
CString GetAnnoLabelCaption();
void SetAnnoLabelCaption(LPCTSTR);
double GetAnnoLabelX();
void SetAnnoLabelX(double);
double GetAnnoLabelY();
void SetAnnoLabelY(double);
unsigned long GetAnnoLabelColor();
void SetAnnoLabelColor(unsigned long);
BOOL GetAnnoLabelHorizontal();
void SetAnnoLabelHorizontal(BOOL);
short GetAnnotation();
void SetAnnotation(short);
BOOL GetAnnoVisible();
void SetAnnoVisible(BOOL);
short GetAnnoCount();
void SetAnnoCount(short);
short GetElement();
void SetElement(short);
short GetElementCount();
void SetElementCount(short);
unsigned long GetAnnoLabelBkColor();
void SetAnnoLabelBkColor(unsigned long);
short GetCursorCount();
void SetCursorCount(short);
short GetCursor();
void SetCursor(short);
double GetCursorX();
void SetCursorX(double);
double GetCursorY();
void SetCursorY(double);
short GetCursorStyle();
void SetCursorStyle(short);
BOOL GetCursorVisible();
void SetCursorVisible(BOOL);
short GetCursorMode();
void SetCursorMode(short);
CString GetFormatAxisBottom();
void SetFormatAxisBottom(LPCTSTR);
CString GetFormatAxisLeft();
void SetFormatAxisLeft(LPCTSTR);
BOOL GetYTime();
void SetYTime(BOOL);
BOOL GetXTime();
void SetXTime(BOOL);

// Operations
public:
void SetRange(double xmin, double xmax, double ymin, double ymax);
void AutoRange();
void CopyToClipboard();
void PrintGraph();
void AddElement();
void DeleteElement(short ElementID);
void ClearGraph();
double GetElementXValue(long index, short ElementID);
void SetElementXValue(long index, short ElementID, double newValue);
double GetElementYValue(long index, short ElementID);
void SetElementYValue(long index, short ElementID, double newValue);
void PlotXY(double X, double Y, short ElementID);
void PlotY(double Y, short ElementID);
void ShowProperties();
void SaveAs(LPCTSTR szFilename);
void AddAnnotation();
void DeleteAnnotation(short annoID);
void AddCursor();
void DeleteCursor(short cursorID);
void AboutBox();
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_NTGRAPH_H__DD0B623C_C9D1_49B8_8512_A2D69335842D__INCLUDED_)
没有你那个函数,所以只能自己画,还好用
DoZoom这个是在源码的鼠标左键按下那个里面的,你有改过源码吗