请教:为什么加了包括了一个.h文件后,MessageBox就不让用了?分有的是,随便加!

wixwiz 2003-11-06 12:19:26
问题如下:
后加入的dpl.h文件如下:

#ifndef DPL_TYPES_H
#define DPL_TYPES_H

/**
* @ Darwin Programming Library
*/

#include "dpl.h"

#ifdef __cplusplus
extern "C"{
#endif

typedef unsigned char dpl_uint8_t;
typedef unsigned short dpl_uint16_t;
typedef unsigned int dpl_uint32_t;

typedef signed char dpl_int8_t;
typedef signed short dpl_int16_t;
typedef signed int dpl_int32_t;

#ifdef _WIN32
typedef _int64 dpl_int64_t;
#else
typedef long long dpl_int64_t;
#endif

typedef unsigned int dpl_size_t;

typedef int dpl_second_t;

typedef dpl_uint16_t dpl_port_t;

typedef dpl_uint16_t dpl_wchar_t;

#ifdef __cplusplus
}
#endif

#endif
//dpl.h文件结束

stdafx.h 如下:
#include <stdio.h>
#include "dpl.h"// 没有这个语句,就没有问题

#using <mscorlib.dll>
#using <System.dll>
#using <System.Xml.dll>
#using <System.Windows.Forms.dll>

#using <System.Drawing.dll>
#using <System.Data.dll>
#include <tchar.h>

using namespace System;
using namespace System::Xml;
using namespace System::ComponentModel;
using namespace System::Windows::Forms;
using namespace System::Drawing;
using namespace System::IO;
using namespace System::Data;
using namespace System::Data::SqlClient;
using namespace System::Collections;
using namespace System::Windows;
using namespace System::Windows::Forms;


当一用下面的语句:
System::Windows::Forms::MessageBox("SS");
就出现如下提示:

编译时提示:e:\VC\count\SmsForm.cpp(213): error C2039: “MessageBoxA” : 不是“System::Windows::Forms”的成员
要是在stdafx.h中去掉#include "dpl.h,MessageBox函数就可正常使用?
何故?请教了。谢谢。
还有一万多分呢,愿与网友分享!
...全文
39 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
LighBlade 2003-11-06
  • 打赏
  • 举报
回复
同意阿亮。
加了头文件,就进入了c++.net非托管状态了.
System.windows.Forms下面的东西都是在托管状态下的程序集.
randy0623 2003-11-06
  • 打赏
  • 举报
回复
<mscorlib.dll>加入后MESSAGEBOX声明为宏(MESSAGEBOXA和MESSAGEBOXW),所以不能同时用
顾君彦 2003-11-06
  • 打赏
  • 举报
回复
加了头文件,就进入了c++.net非托管状态了.
System.windows.Forms下面的东西都是在托管状态下的程序集.
wixwiz 2003-11-06
  • 打赏
  • 举报
回复
up

111,094

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

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