02 2024 档案
摘要:// 反射判断是否位某个类型 public bool IsSubclassOf(this Type type, Type baseType) { // 如果type不是null并且baseType是一个类(非接口) if (type != null && baseType.IsClass) { re
阅读全文
摘要:SetWindowText(_T("MFC 测试")); // 设置窗体标题 CString str; GetWindowText(str); // 获取窗体标题内容 /********************************************************/ CString
阅读全文
摘要:浅拷贝 静态数组的空间体现深拷贝的效果 #include <iostream> #include <string> using namespace std; #define SEX_SIZE 10 class Student { public: Student(string name) { Age
阅读全文
摘要:C#: static void Main(string[] args) { bool result = true; result &= Func(); result &= Func(); result &= Func(); Console.WriteLine("&= 最后结果:{0}\n", res
阅读全文
摘要:成员变量关联: private: CMFCButton m_btnColorTest; CMFCButton* m_pBtnColor; // CMFCAppColorDlg 对话框 #define DELETE(ptr) do{if (ptr) {delete ptr; ptr = nullptr
阅读全文
摘要:#include "afxwin.h" #include <iostream> using namespace std; int main() { CString cs = _T("西游记"); AfxMessageBox(_T("CString:") + cs); // CString 转 ACS
阅读全文
摘要:#include <iostream> using namespace std; typedef int INT, * PINT; typedef int* PINT32, INT32; int main() { int* p, a; a = 10; p = &a; cout << *p << en
阅读全文
摘要:▲ Demo 示例 新建基于对话框的 Demo程序。 头文件: // 自定义数据类型,用来测试消息数据传递 typedef struct tagStudent { CString Name; int Age; }Student_t; // Dlg header public: afx_msg voi
阅读全文
摘要:#include "Windows.h" #include <stdlib.h> #include <stdio.h> DWORD WINAPI ThreadFunc(LPVOID param) { printf("启动线程\n"); return 0; } int main() { DWORD t
阅读全文
摘要:测试类: #pragma once ref class Hello { public: Hello(); ~Hello(); !Hello(); }; /***************/ #include "Hello.h" Hello::Hello() { System::Console::Wri
阅读全文