//我对MFC不是很熟,这里的CDialog应该用TForm么?希望高手最好能帮我完整翻译以下代码!谢过先!
#if !defined(AFX_MYOUTPUT_H__3AA4D4E4_4592_47A7_B42E_1B68A6E6C913__INCLUDED_)
#define AFX_MYOUTPUT_H__3AA4D4E4_4592_47A7_B42E_1B68A6E6C913__INCLUDED_#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// MyOutput.h : header file
///////////////////////////////////////////////////////////////////////////////
// CMyOutput dialogtypedef struct{
long bToScreen;
long bToVideoOut;
long nLeft;
long nTop;
long nWidth;
long nHeight;
long nReserved;
}DISPLAY_PARA_OUT,*PDISPLAY_PARA_OUT;
class CMyOutput : public CDialog
{
// Construction
public:
CMyOutput(CWnd* pParent = NULL);   // standard constructor int m_iPlayhandle;
BOOL m_bFileSave;
BOOL m_bNeedjudge;
BOOL m_bPlaying;
UINT m_iSubWndNumber;
CString m_csIP;
DWORD m_dwDVRIP;
int  m_iChannel;
LONG m_lServerID;
DISPLAY_PARA_OUT m_display_para;
int m_iWindowNum;
time_t m_lChangeFileNameTime;

void StopNet();
void StartNet(PIP_INFO ipinfo);
void StartCard(PIP_INFO ipinfo);
void invateframe();
// Dialog Data
//{{AFX_DATA(CMyOutput)
enum { IDD = IDD_MYOUTPUT };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMyOutput)
public:
virtual BOOL DestroyWindow();
virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);
protected:
virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
//}}AFX_VIRTUAL// Implementation
protected: // Generated message map functions
//{{AFX_MSG(CMyOutput)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
afx_msg void OnDestroy();
afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnPaint();
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnMenuFrontpage();
afx_msg void OnMenuNextpage();
afx_msg void OnMenuPausecycle();
afx_msg void OnMenuSound();
afx_msg void OnMenuMultiscreen();
virtual BOOL OnInitDialog();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.#endif // !defined(AFX_MYOUTPUT_H__3AA4D4E4_4592_47A7_B42E_1B68A6E6C913__INCLUDED_)

解决方案 »

  1.   

    可以用TForm 替代
    public:
    CMyOutput(CWnd* pParent = NULL);   // 构造函数,Delphi对应的TForm 用自动生成 int m_iPlayhandle; //成员变量,自己可以在TForm中定义
    BOOL m_bFileSave;
    BOOL m_bNeedjudge;
    BOOL m_bPlaying;
    UINT m_iSubWndNumber;
    CString m_csIP;
    DWORD m_dwDVRIP;
    int  m_iChannel;
    LONG m_lServerID;
    DISPLAY_PARA_OUT m_display_para;
    int m_iWindowNum;
    time_t m_lChangeFileNameTime;

    void StopNet();    //成员函数,自己可以在TForm中定义
    void StartNet(PIP_INFO ipinfo);
    void StartCard(PIP_INFO ipinfo);
    void invateframe();
    // Dialog Data
    //{{AFX_DATA(CMyOutput)
    enum { IDD = IDD_MYOUTPUT };  //对应的对话框ID,TForm自动生成
    // NOTE: the ClassWizard will add data members here
    //}}AFX_DATA
    // Overrides
    // ClassWizard generated virtual function overrides
    //{{AFX_VIRTUAL(CMyOutput)
    public:
    virtual BOOL DestroyWindow();   //消息函数,TForm的事件列表里有
    virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);
    protected: //消息映射,Delphi 已经自动映射好了
    virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
    //}}AFX_VIRTUAL// Implementation
    protected: // Generated message map functions
    //{{AFX_MSG(CMyOutput)
    afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);   //消息函数,TForm的事件列表里有
    afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
    afx_msg void OnDestroy();
    afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
    afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
    afx_msg void OnMouseMove(UINT nFlags, CPoint point);
    afx_msg void OnPaint();
    afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
    afx_msg void OnTimer(UINT nIDEvent);
    afx_msg void OnMenuFrontpage();
    afx_msg void OnMenuNextpage();
    afx_msg void OnMenuPausecycle();
    afx_msg void OnMenuSound();
    afx_msg void OnMenuMultiscreen();
    virtual BOOL OnInitDialog();
    //}}AFX_MSG
    DECLARE_MESSAGE_MAP()
    };