Основные навыки работы с MFC, страница 2

#define IDD_OK                          1000

#define IDD_CANCEL                      1001

#define IDC_STX                         1006

#define IDC_STY                         1007

#define IDC_A                           1010

#define IDC_B                           1011

#define IDC_SCX                         1012

#define IDC_U0K                         1012

#define IDC_SCY                         1013

#define IDC_U0B                         1013

#define IDC_C                           1014

#define IDC_A11                         1014

#define IDC_A12                         1015

#define IDC_A13                         1016

#define IDC_A14                         1017

#define IDC_A21                         1018

#define IDC_A22                         1019

#define IDC_A23                         1020

#define IDC_A24                         1021

#define IDC_B1                          1022

#define IDC_B2                          1023

#define IDC_B3                          1024

#define IDC_B4                          1025

#define IDC_AM                          1026

#define IDC_TAU                         1027

#define IDC_HM                          1028

#define IDC_A0                          1030

#define IDC_S0                          1031

#define IDC_S1                          1032

#define IDC_B0                          1033

#define ID_FILE_EXIT                    40001

#define ID_OPTIONS                      40002

// Next default values for new objects

//

#ifdef APSTUDIO_INVOKED

#ifndef APSTUDIO_READONLY_SYMBOLS

#define _APS_NEXT_RESOURCE_VALUE        104

#define _APS_NEXT_COMMAND_VALUE         40004

#define _APS_NEXT_CONTROL_VALUE         1015

#define _APS_NEXT_SYMED_VALUE           101

#endif

#endif

MainWnd.h

#include "StdAfx.h"

class CMainWnd : public CFrameWnd //Class of main window

{

public:

      afx_msg void OnPaint();

      CMainWnd();//Default constructor

      int OnCreate(void);//Window-create function

      ~CMainWnd();//Destructor

      void OnMenuExit();

      void OnMenuOptions();

      data z;

private:

      double myasl (double);

      double fi2(double);

      double fi3(double);

      void drawit (void);

      CMenu m_wndMenu;

      DECLARE_MESSAGE_MAP();//App answers on reaction

};

BEGIN_MESSAGE_MAP(CMainWnd, CFrameWnd)//Reaction-Table

ON_COMMAND(ID_FILE_EXIT,OnMenuExit)

ON_COMMAND(ID_OPTIONS, OnMenuOptions)

ON_WM_PAINT()

END_MESSAGE_MAP()

CMainWnd::CMainWnd()//Default Constructor

{

Create(NULL,"3dGraph †",WS_OVERLAPPEDWINDOW,rectDefault,NULL,NULL);//MainWindow create function

OnCreate();

}

int CMainWnd::OnCreate(void)

{

m_wndMenu.LoadMenu(IDR_MENU);//Load prepared menu

SetMenu(&m_wndMenu);//Install menu into window

      z.A0=1;

      z.A11=1;

      z.A12=1;

      z.A13=1;

      z.A14=1;

      z.A21=1;

      z.A22=1;

      z.A23=1;

      z.A24=1;

      z.B0=1;

      z.B1=1;

      z.B2=1;

      z.B3=1;

      z.B4=1;

      z.AM=1;

      z.HM=1;

      z.S0=0;

      z.S1=0;

      z.TAU=0;

      z.U0B=10;

      z.U0K=0;

return 0;

}

CMainWnd::~CMainWnd()//Destructor

{

}

void CMainWnd::OnMenuExit()

{

DestroyWindow();