2024年3月30日发(作者:)
西安电子科技大学
《操作系统原理》实验报告
题目: 进程通信实验报告
班级: 030912
姓名: 王增祥
学号: 03091168
实验内容补充说明:
一、分析和设计
1. 理论分析
每个Windows进程都是由一个执行体进程块(EPROCESS)表示。API函数CreatProcess
可以创建进程,采用管道技术可以实现进程间的相互通信。建立pipe,进程以及其子进程就
可以对该管道进程读写共享,管道读写操作利用,write、read、close进行。父进程利用pipe
发送消息,子进程利用该pipe接收父进程发来的消息;子进程利用管道向父进程发送应答,
父进程利用该pipe接受应答。
2. 总体设计
1、利用CreatProcess函数创建进程。
2、创建管道,实现进程间的通信
二、详细实现
1、创建界面,采用Botton、列表框等控件创建父子界面如下图:
父进程界面:
子进程界面:
其中父进程各个空间创建类向导如图:
子进程创建类向导如图:
2.父进程编写
(1)创建管道:
(2)创建子进程:
(3)消息发送
(4)消息接受
3.子进程编写
(1)发送消息
(2)读消息
三、实验结果
点击创建子进程按钮:
在创建子进程之后进行进程间的通信如下图
四、心得体会
1、从试验的角度了解了进程间是怎样利用管道进行通信的,了解了进程间通信的实际过程
2、进一步掌握了MFC的初步编程技巧,知道了怎样调试程序。
3进一步了解了,API函数的应用,明白了怎样进行界面编程。
4、进一步熟悉了在进行进程通信的编写过程中的各个细节。
六、附录
Process_
#include "stdafx.h"
#include "Process_Father.h" //包含已编写的Process_Father.h头文件
#include "Process_FatherDlg.h" //包含已编写的Process_FatherDlg.h头文件
//进行宏定义
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//创建父进程
BEGIN_MESSAGE_MAP(CProcess_FatherApp, CWinApp)
//{{AFX_MSG_MAP(CProcess_FatherApp)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()
// CProcess_FatherApp construction
CProcess_FatherApp::CProcess_FatherApp()
{
}
// The one and only CProcess_FatherApp object
CProcess_FatherApp theApp;
// CProcess_FatherApp initialization
// TODO: add construction code here,
// Place all significant initialization in InitInstance
BOOL CProcess_FatherApp::InitInstance()
{
AfxEnableControlContainer();
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
CProcess_FatherDlg dlg;
m_pMainWnd = &dlg;
int nResponse = l();
if (nResponse == IDOK)
{
}
else if (nResponse == IDCANCEL)
{
}
// TODO: Place code here to handle when the dialog is
// dismissed with Cancel
// TODO: Place code here to handle when the dialog is
// dismissed with OK
}
// Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.
return FALSE;
Process_
// Process_ : implementation file
//
#include "stdafx.h"
#include "Process_Father.h"
#include "Process_FatherDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
// Dialog Data
// Implementation
protected:
};
//{{AFX_MSG(CAboutDlg)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA
CAboutDlg();
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CProcess_FatherDlg dialog
CProcess_FatherDlg::CProcess_FatherDlg(CWnd* pParent /*=NULL*/)
{
}
void CProcess_FatherDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CProcess_FatherDlg)
//{{AFX_DATA_INIT(CProcess_FatherDlg)
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
: CDialog(CProcess_FatherDlg::IDD, pParent)
DDX_Control(pDX, IDC_BT_CreateChildProcess, m_BT_CreateChildProcess);
}
BEGIN_MESSAGE_MAP(CProcess_FatherDlg, CDialog)
DDX_Control(pDX, IDC_Send, m_Send);
DDX_Control(pDX, IDC_LISTBOX_Record, m_LISTBOX_Record);
DDX_Control(pDX, IDC_EDIT_Message, m_EDIT_Message);
//}}AFX_DATA_MAP
//{{AFX_MSG_MAP(CProcess_FatherDlg)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_BN_CLICKED(IDC_BT_CreateChildProcess, OnBTCreateChildProcess)
ON_BN_CLICKED(IDC_Send, OnSend)
//}}AFX_MSG_MAP
ON_MESSAGE(WM_CHILD_SEND,OnReceiveMsg)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CProcess_FatherDlg message handlers
BOOL CProcess_FatherDlg::OnInitDialog()
{
// Add "" menu item to system menu.
CDialog::OnInitDialog();
// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
}
CString strAboutMenu;
ring(IDS_ABOUTBOX);
if (!y())
{
}
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE);
SetIcon(m_hIcon, FALSE);
// TODO: Add extra initialization here
// Set big icon
// Set small icon
}
return TRUE; // return TRUE unless you set the focus to a control
void CProcess_FatherDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
}
// If you add a minimize button to your dialog, you will need the code below
// to draw the icon. For MFC applications using the document/view model,
// this is automatically done for you by the framework.
void CProcess_FatherDlg::OnPaint()
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
}
else
{
}
CDialog::OnSysCommand(nID, lParam);
CAboutDlg dlgAbout;
l();
}
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND, (WPARAM) eHdc(), 0);
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (() - cxIcon + 1) / 2;
int y = (() - cyIcon + 1) / 2;
}
// Draw the icon
on(x, y, m_hIcon);
else
{
}
CDialog::OnPaint();
// The system calls this to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR CProcess_FatherDlg::OnQueryDragIcon()
{
}
void CProcess_FatherDlg::OnBTCreateChildProcess()
{
//创建管道
return (HCURSOR) m_hIcon;
SECURITY_ATTRIBUTES sa;
h=sizeof(SECURITY_ATTRIBUTES);
rityDescriptor=NULL;
itHandle=TRUE;
::CreatePipe(&hPipeRead,&hPipeWrite,&sa,0);
//创建子进程
STARTUPINFO StartupInfo;
::CreatePipe(&hPipeRead2,&hPipeWrite2,&sa,0);
memset(&StartupInfo,0,sizeof(STARTUPINFO)) ;
=sizeof(STARTUPINFO);
s=STARTF_USESTDHANDLES;
put=hPipeRead;
tput=hPipeWrite;
ror=GetStdHandle(STD_ERROR_HANDLE);
PROCESS_INFORMATION ProcessInfo;
::CreateProcess("Process_",NULL,NULL,NULL,TRUE,0,NULL,NULL,&Startu
pInfo,&ProcessInfo);
m_BT_Window(FALSE);
}
void CProcess_FatherDlg::OnSend()
{
CString str;
char ss[20]="Father:";
m_EDIT_dowText(str);
DWORD dwWritten;
if(!WriteFile(hPipeWrite,str,40,&dwWritten,NULL))
CString strWinName = "Process_Child";
CWnd *pWnd=CWnd::FindWindow(NULL,strWinName);
if(pWnd)
{
pWnd->SendMessage(WM_FATHER_SEND,0,0);
{
}
MessageBox(TEXT("写错误"),"警告",MB_OK|MB_ICONWARNING);
}
strcat(ss,str);
m_LISTBOX_String(-1,ss);
m_EDIT_dowText("");
else
{
MessageBox("没有发现子进程","错误");
}
}
void CProcess_FatherDlg::OnReceiveMsg(WPARAM wParam,LPARAM lParam)
{
}
Process_Father.h
// Process_Father.h : main header file for the PROCESS_FATHER application
//
#if !defined(AFX_PROCESS_FATHER_H__1F9659A2_2B93_4C1E_89C5_5A88971D3DDA__INCLUD
ED_)
#define AFX_PROCESS_FATHER_H__1F9659A2_2B93_4C1E_89C5_5A88971D3DDA__INCLUDED_
char str[60]="Child: ";
strcat(str,s);
m_LISTBOX_String(-1,str);
DWORD dwRead;
TCHAR s[40];
HANDLE hPipeRead2;
hPipeRead2=GetStdHandle(STD_INPUT_HANDLE);
if(!ReadFile(hPipeRead,s,40,&dwRead,NULL))
{
}
MessageBox(TEXT("读错误!"),"警告",MB_OK|MB_ICONWARNING);
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h"
/////////////////////////////////////////////////////////////////////////////
// CProcess_FatherApp:
// See Process_ for the implementation of this class
//
class CProcess_FatherApp : public CWinApp
{
public:
// Overrides
// ClassWizard generated virtual function overrides
CProcess_FatherApp();
// main symbols
//{{AFX_VIRTUAL(CProcess_FatherApp)
public:
virtual BOOL InitInstance();
//}}AFX_VIRTUAL
// Implementation
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the
previous line.
#endif
//{{AFX_MSG(CProcess_FatherApp)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
// !defined(AFX_PROCESS_FATHER_H__1F9659A2_2B93_4C1E_89C5_5A88971D3DDA__INCLUDE
D_)
Process_FatherDlg.h
// Process_FatherDlg.h : header file
//
#if !defined(AFX_PROCESS_FATHERDLG_H__69E2942A_7A5F_413F_B4A3_AFB8C1F51DFE__INC
LUDED_)
#define
AFX_PROCESS_FATHERDLG_H__69E2942A_7A5F_413F_B4A3_AFB8C1F51DFE__INCLUDED_
#define WM_FATHER_SEND WM_USER+100
#define WM_CHILD_SEND WM_USER+101
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
/////////////////////////////////////////////////////////////////////////////
// CProcess_FatherDlg dialog
class CProcess_FatherDlg : public CDialog
{
// Construction
public:
// Dialog Data
// Implementation
protected:
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CProcess_FatherDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX);
//}}AFX_VIRTUAL
// DDX/DDV support
//{{AFX_DATA(CProcess_FatherDlg)
enum { IDD = IDD_PROCESS_FATHER_DIALOG };
CButton m_BT_CreateChildProcess;
CButton m_Send;
CListBox m_LISTBOX_Record;
CProcess_FatherDlg(CWnd* pParent = NULL); // standard constructor
CEdit m_EDIT_Message;
//}}AFX_DATA
HICON m_hIcon;
// Generated message map functions
//{{AFX_MSG(CProcess_FatherDlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnReceiveMsg(WPARAM wParam, LPARAM lParam);
afx_msg void OnBTCreateChildProcess();
afx_msg void OnSend();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the
HANDLE hPipeWrite2;
HANDLE hPipeRead2;
HANDLE hPipeWrite;
HANDLE hPipeRead;
previous line.
#endif
// !defined(AFX_PROCESS_FATHERDLG_H__69E2942A_7A5F_413F_B4A3_AFB8C1F51DFE__INCL
UDED_)
子进程代码
Process_
// Process_ : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "Process_Child.h"
#include "Process_ChildDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CProcess_ChildApp
BEGIN_MESSAGE_MAP(CProcess_ChildApp, CWinApp)
//{{AFX_MSG_MAP(CProcess_ChildApp)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CProcess_ChildApp construction
CProcess_ChildApp::CProcess_ChildApp()
{
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CProcess_ChildApp object
// TODO: add construction code here,
// Place all significant initialization in InitInstance
CProcess_ChildApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CProcess_ChildApp initialization
BOOL CProcess_ChildApp::InitInstance()
{
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.
AfxEnableControlContainer();
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
CProcess_ChildDlg dlg;
m_pMainWnd = &dlg;
}
int nResponse = l();
if (nResponse == IDOK)
{
}
else if (nResponse == IDCANCEL)
{
}
// TODO: Place code here to handle when the dialog is
// dismissed with Cancel
// TODO: Place code here to handle when the dialog is
// dismissed with OK
// Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.
return FALSE;
Process_
// Process_ : implementation file
//
#include "stdafx.h"
#include "Process_Child.h"
#include "Process_ChildDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
// Dialog Data
// ClassWizard generated virtual function overrides
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA
CAboutDlg();
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
//{{AFX_MSG(CAboutDlg)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
}
//}}AFX_DATA_MAP
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CProcess_ChildDlg dialog
CProcess_ChildDlg::CProcess_ChildDlg(CWnd* pParent /*=NULL*/)
{
}
void CProcess_ChildDlg::DoDataExchange(CDataExchange* pDX)
//{{AFX_DATA_INIT(CProcess_ChildDlg)
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
: CDialog(CProcess_ChildDlg::IDD, pParent)
{
}
BEGIN_MESSAGE_MAP(CProcess_ChildDlg, CDialog)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
//{{AFX_MSG_MAP(CProcess_ChildDlg)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_BN_CLICKED(IDC_Send, OnSend)
//}}AFX_MSG_MAP
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CProcess_ChildDlg)
DDX_Control(pDX, IDC_Send, m_Send);
DDX_Control(pDX, IDC_LISTBOX_Record, m_LISTBOX_Record);
DDX_Control(pDX, IDC_EDIT_Message, m_EDIT_Message);
//}}AFX_DATA_MAP
ON_MESSAGE(WM_FATHER_SEND,OnReceiveMsg)
// CProcess_ChildDlg message handlers
BOOL CProcess_ChildDlg::OnInitDialog()
{
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
ring(IDS_ABOUTBOX);
if (!y())
{
}
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);
// Add "" menu item to system menu.
CDialog::OnInitDialog();
}
}
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE);
SetIcon(m_hIcon, FALSE);
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
// Set big icon
// Set small icon
void CProcess_ChildDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
}
else
{
CDialog::OnSysCommand(nID, lParam);
CAboutDlg dlgAbout;
l();
}
}
// If you add a minimize button to your dialog, you will need the code below
// to draw the icon. For MFC applications using the document/view model,
// this is automatically done for you by the framework.
void CProcess_ChildDlg::OnPaint()
{
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (() - cxIcon + 1) / 2;
int y = (() - cyIcon + 1) / 2;
SendMessage(WM_ICONERASEBKGND, (WPARAM) eHdc(), 0);
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
}
// The system calls this to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR CProcess_ChildDlg::OnQueryDragIcon()
{
}
void CProcess_ChildDlg::OnSend()
{
char ss[20]="Child:";
return (HCURSOR) m_hIcon;
}
else
{
}
CDialog::OnPaint();
// Draw the icon
on(x, y, m_hIcon);
CString str;
m_EDIT_dowText(str);
DWORD dwWritten;
hPipeWrite=GetStdHandle(STD_OUTPUT_HANDLE);
if(!WriteFile(hPipeWrite,str,40,&dwWritten,NULL))
CString strWinName = "Process_Father";
CWnd *pWnd=CWnd::FindWindow(NULL,strWinName);
if(pWnd)
{
pWnd->SendMessage(WM_CHILD_SEND,0,0);
{
}
MessageBox(TEXT("写错误"),"警告",MB_OK|MB_ICONWARNING);
}
strcat(ss,str);
m_LISTBOX_String(-1,ss);
m_EDIT_dowText("");
else
{
MessageBox("没有发现父进程","错误");
}
}
void CProcess_ChildDlg::OnReceiveMsg(WPARAM wParam,LPARAM lParam)
{
}
Process_Child.h
// Process_Child.h : main header file for the PROCESS_CHILD application
//
#if !defined(AFX_PROCESS_CHILD_H__7416C60C_DD56_40CC_BD28_3DA310873DE7__INCLUDE
char str[60]="Father: ";
strcat(str,s);
m_LISTBOX_String(-1,str);
hPipeRead=GetStdHandle(STD_INPUT_HANDLE);
if(!ReadFile(hPipeRead,s,40,&dwRead,NULL))
{
}
MessageBox(TEXT("读错误!"),"警告",MB_OK|MB_ICONWARNING);
DWORD dwRead;
char s[40];
HANDLE hPipeRead;
D_)
#define AFX_PROCESS_CHILD_H__7416C60C_DD56_40CC_BD28_3DA310873DE7__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h"
/////////////////////////////////////////////////////////////////////////////
// CProcess_ChildApp:
// See Process_ for the implementation of this class
//
class CProcess_ChildApp : public CWinApp
{
public:
CProcess_ChildApp();
// main symbols
// Overrides
// Implementation
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the
//{{AFX_MSG(CProcess_ChildApp)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CProcess_ChildApp)
public:
virtual BOOL InitInstance();
//}}AFX_VIRTUAL
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
previous line.
#endif
// !defined(AFX_PROCESS_CHILD_H__7416C60C_DD56_40CC_BD28_3DA310873DE7__INCLUDED
_)
Process_ChildDlg.h
// Process_ChildDlg.h : header file
//
#if !defined(AFX_PROCESS_CHILDDLG_H__01C41D47_4973_4DCB_84FC_4B7C5A6C584A__INCL
UDED_)
#define AFX_PROCESS_CHILDDLG_H__01C41D47_4973_4DCB_84FC_4B7C5A6C584A__INCLUDED_
#define WM_FATHER_SEND WM_USER+100
#define WM_CHILD_SEND WM_USER+101
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
/////////////////////////////////////////////////////////////////////////////
// CProcess_ChildDlg dialog
class CProcess_ChildDlg : public CDialog
{
// Construction
public:
CProcess_ChildDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CProcess_ChildDlg)
enum { IDD = IDD_PROCESS_CHILD_DIALOG };
CButton m_Send;
CListBox m_LISTBOX_Record;
CEdit m_EDIT_Message;
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CProcess_ChildDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX);
//}}AFX_VIRTUAL
// DDX/DDV support
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CProcess_ChildDlg)
virtual BOOL OnInitDialog();
HICON m_hIcon;
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnReceiveMsg(WPARAM wParam, LPARAM lParam);
afx_msg void OnSend();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the
previous line.
#endif
// !defined(AFX_PROCESS_CHILDDLG_H__01C41D47_4973_4DCB_84FC_4B7C5A6C584A__INCLU
DED_)
HANDLE hPipeWrite;


发布评论