mfc宏定义问题

阿狸Ahri 2014-02-04 12:03:20

// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//

#if !defined(AFX_STDAFX_H__8A98015B_E778_4CF2_A2C9_0DC5A1F22C29__INCLUDED_)
#define AFX_STDAFX_H__8A98015B_E778_4CF2_A2C9_0DC5A1F22C29__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers

#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdisp.h> // MFC Automation classes
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
/************************************************************************/
/* 宏定义 */
/************************************************************************/
#define F_WHITE 1
#define F_BLACK -1
#define F_NULL_CHESS 0
#define F_WIN_WHITE -100
#define F_WIN_BLACK -101
#define F_NULL_SATATE -102
#define F_TIME_DOWN 2
#define F_TIME_COUNT 3
/*****音乐类******/
#define F_MUSIC_BEGIN 1
#define F_MUSIC_LOST 2
#define F_MUSIC_PUTCHESS 3
#define F_MUSIC_WIN 4
#define F_MUSIC_WARNING3 5
#define F_MUSIC_WARNING4 6
/*****套接字类******/
#define F_DATA_MGS 1 //这里不是定义有吗
#define F_DATA_CHESS 2

#include <afxsock.h> // MFC socket extensions
#include "RoundButton.h"
#include "Rule.h"
#include <mmsystem.h>
#include <stack>
#include <math.h>
using namespace std;
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_STDAFX_H__8A98015B_E778_4CF2_A2C9_0DC5A1F22C29__INCLUDED_)



void CFIVE_CHESSDlg::Data_Send_Msg(int tpye,CString msg/* =NULL */,DATA_MSG *data/* =NULL */)
{
if (F_DATA_CHESS==tpye)
{
s_client.Send((LPVOID)data,sizeof(DATA_MSG));
}
if (F_DATA_MGS==tpye)
{
s_client.Send(msg,msg.GetLength()+1);
}
}


我前面的宏定义都没问题 就后面两个出问题了 表示不知到错哪里,他说我没定义........我无语了

...全文
203 8 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
阿狸Ahri 2014-02-08
  • 打赏
  • 举报
回复
本来重新编译也没用,然后我也不知道怎么回事,我昨天重新复制来了,运行老程序又行了,日
  • 打赏
  • 举报
回复
可能是顺序问题。在使用当前函数定义。
rxguoblp 2014-02-08
  • 打赏
  • 举报
回复
挪一下位置,把 #define F_DATA_MGS 1 //这里不是定义有吗 #define F_DATA_CHESS 2 放到using namespace std后面试试
mlqxj35674 2014-02-07
  • 打赏
  • 举报
回复
你的宏是 F_DATA_MGS不是DATA_MGS
jay102030 2014-02-07
  • 打赏
  • 举报
回复
删除多余文件重新编译吧
阿狸Ahri 2014-02-04
  • 打赏
  • 举报
回复
用MFC写,新手 真是压力大
晒月光的青蛙 2014-02-04
  • 打赏
  • 举报
回复
stdafx.h会预编译的,你rebuild一下试试呢

16,548

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • AIGC Browser
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧