大菜问题:CHAR和char,BOOL和bool, CString和cstring有什么区别?

cniao 2002-05-15 08:43:49
~~~~~~~
...全文
50 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
cniao 2002-05-15
  • 打赏
  • 举报
回复
说错了,是string

那样说来char == CHAR, 而BOOL就是int 0和 1 喽?
kingofvc 2002-05-15
  • 打赏
  • 举报
回复
如果写成那样的形式的话你就明白了
typedef char CHAR;
typedef int BOOL;(?我记得是那样的因为c中没有bool类型)
CString 是mfc的一个类cstring 没见过
char bool 都是c++的关键字
superS 2002-05-15
  • 打赏
  • 举报
回复
大小写不一样。哈哈。
#ifndef __REGISTRY_H__ #define __REGISTRY_H__ class CRegistry { public: CRegistry(); ~CRegistry(); int m_nLastError; // CRegistry properties protected: HKEY m_hRootKey; BOOL m_bLazyWrite; CString m_strCurrentPath; public: inline BOOL PathIsValid() { return (m_strCurrentPath.GetLength() > 0); } inline CString GetCurrentPath() { return m_strCurrentPath; } inline HKEY GetRootKey() { return m_hRootKey; } //CRegistry methods public: BOOL ClearKey(); BOOL SetRootKey(HKEY hRootKey); BOOL CreateKey(CString strKey); BOOL DeleteKey(CString strKey); BOOL DeleteValue(CString strName); int GetDataSize(CString strValueName); DWORD GetDataType(CString strValueName); int GetSubKeyCount(); int GetValueCount(); BOOL KeyExists(CString strKey, HKEY hRootKey = NULL); BOOL SetKey(CString strKey, BOOL bCanCreate); BOOL ValueExists(CString strName); void RenameValue(CString strOldName, CString strNewName); // data reading functions COleDateTime ReadDateTime(CString strName, COleDateTime dtDefault); double ReadFloat(CString strName, double fDefault); CString ReadString(CString strName, CString strDefault); int ReadInt(CString strName, int nDefault); BOOL ReadBool(CString strName, BOOL bDefault); COLORREF ReadColor(CString strName, COLORREF rgbDefault); BOOL ReadFont(CString strName, CFont* pFont); BOOL ReadPoint(CString strName, CPoint* pPoint); BOOL ReadSize(CString strName, CSize* pSize); BOOL ReadRect(CString strName, CRect* pRect); DWORD ReadDword(CString strName, DWORD dwDefault); // data writing functions BOOL WriteBool(CString strName, BOOL bValue); BOOL WriteDateTime(CString strName, COleDateTime dtValue); BOOL WriteString(CString strName, CString strValue); BOOL WriteFloat(CString strName, double fValue); BOOL WriteInt(CString strName, int nValue); BOOL WriteColor(CString strName, COLORREF rgbValue); BOOL WriteFont(CString strName, CFont* pFont); BOOL WritePoint(CString strName, CPoint* pPoint); BOOL WriteSize(CString strNam
GPRS收发短信原代码 wince5.0平台以下或以上兼容 class CGPRS { public: CGPRS(); virtual ~CGPRS(); BOOL GPRS_Init(LPCTSTR Port, int BaudRate, DWORD UserParam); // GPRS 回调函数 typedef void (CALLBACK *ONGPRSRECV)(DWORD UserParam, DWORD Status, CString strData); ONGPRSRECV OnGPRSRecv; BOOL GPRS_DialUp(CString strTelNum); BOOL GPRS_DialDown(void); BOOL GPRS_TakeTheCall(void); BOOL GPRS_HangUpTheCall(void); BOOL GPRS_DeleteShortMsg(DWORD num); BOOL GPRS_ReadShortMessage(DWORD num, CString *strTelCode, CString *Msg); BOOL GPRS_SendShortMessage(CString strTelNum, CString Msg); BOOL GPRS_SetShortMSGCenterTel(CString strTelNum); BOOL GPRS_CheckMsgNum(CString *strNum, CString *strTotal); private: CCeSerial *pCeSerial; DWORD m_UserParam; /* 使用本模块用户 */ HANDLE m_ATCmdRespEvent; /* AT 命令回复事件 */ CString m_strRespBuf; /* 回复缓冲区字符串 */ DWORD m_RespCnt; BOOL bSendATCmd; /* 是否发送了命令 */ void ResetGlobalVarial(void); BOOL GPRS_SendATCmd(CString strCmd); /* 发送 AT 命令 */ BOOL GPRS_WriteMsg(CString Msg); /* 发送短信内容 */ BOOL GPRS_WaitResponseOK(void); /* 等待 AT 命令的响应 */ CString GPRS_GetTheCallNum(CString str); /* 获取打进来的电话的号码 */ //int FindMsgPos(void); /* 查找短信的位置 */ int FindMsgPos(int *posnum, int *numlen, int *posmsg, int *msglen); static void CALLBACK OnCommRecv(DWORD UserParam, BYTE *buf, DWORD buflen); };

16,548

社区成员

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

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

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