美文网首页
MFC: CFile

MFC: CFile

作者: dyg540 | 来源:发表于2017-05-10 09:12 被阅读0次

CFile file;

CFileException pError;

if (file.Open(L"D:\\aa.txt", CFile::modeCreate || CFile::modeReadWrite, &pError))

{

TCHAR str_aa[] = L"AAAwwwww";

file.Write(str_aa, sizeof(str_aa));

file.Flush();

file.Close();

}

else

{

TCHAR szError[1024];

pError.GetErrorMessage(szError, 1024);

AfxMessageBox(szError);

}

/*CColorDialog dlg(RGB(255, 0, 0), CC_FULLOPEN);

dlg.DoModal();*/

CColorDialog dlg;

if (IDOK == dlg.DoModal())

{

COLORREF color = dlg.GetColor();

/*TRACE("RGB value of the selected color - red = %u, green = %u, blue = %u\n",

GetRValue(color), GetGValue(color), GetBValue(color));*/

//BYTE r = GetRValue(color);

//char *str = (char *)r;

//AfxMessageBox((LPCTSTR)str);

this->SetBackgroundColor(color);

}

相关文章

  • MFC: CFile

    CFile file; CFileException pError; if (file.Open(L"D:\\aa...

  • 2017 9 28

    今天对文件的保存与恢复进行了学习共分为四个部分: 1 CFile类 在MFC面向对象的编程方式下,有关文件的输入和...

  • 2017.9.27MFC

    列表试图的应用,在列表试图中添加日期控件! 文件类CFile类的介绍 CFile类的操作 用CFile类的构造函数...

  • 消息映射机制

    MFC.h MFC.cpp

  • 用C/C++编程实现MFC版本飞机大战「含项目源码」

    PlaneWar-MFC是一款MFC版本的飞机大战!程序设计综合实践完成的MFC飞机大战,无MFC基础,菜鸟一个。...

  • 004 Kudu | Cfile解读

    翻译部分来自github地址 https://github.com/cloudera/kudu/blob/mast...

  • 创建项目

    一、 新建MFC项目 选择:基于对话框 MFC的使用:在共享DLL中使用MFC (程序运行需要dll)在静态库中使...

  • MFC_1 桌面应用程序

    https://docs.microsoft.com/zh-cn/cpp/mfc/mfc-desktop-appl...

  • 面向小白的C语言教程(005)-创建MFC界面程序

    创建MFC界面程序 1、创建MFC程序: 直接搜索MFC 如果搜索不到,那就是没安装,连上网络,找到你的Visua...

  • 9.27

    继续MFC。

网友评论

      本文标题:MFC: CFile

      本文链接:https://www.haomeiwen.com/subject/louwtxtx.html