![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C/C++
文章平均质量分 70
xia851773277
这个作者很懒,什么都没留下…
展开
-
简单Win32程序示例
#include #include LRESULT CALLBACK MyWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch(uMsg) { case WM_LBUTTONDBLCLK: MessageBox(hWnd,"dbClick","",MB_YESNO); case WM_L原创 2016-04-29 19:36:01 · 482 阅读 · 0 评论 -
进程通信_剪贴板
void CClipboardDlg::OnBtnSend() { // TODO: Add your control notification handler code here if(OpenClipboard()) { CString str; HANDLE hClip; char *pBuf; EmptyClipboard(); GetDlgI原创 2016-04-29 21:55:44 · 260 阅读 · 0 评论 -
进程通信_匿名管道
服务器端: void CParentView::OnPipeCreate() { // TODO: Add your command handler code here SECURITY_ATTRIBUTES sa; sa.bInheritHandle=TRUE; sa.lpSecurityDescriptor=NULL; sa.nLength=sizeof(SECURI原创 2016-04-29 21:53:46 · 246 阅读 · 0 评论 -
拷贝构造函数与赋值构造函数
#include #include using namespace std; class String { private: char *m_data; public: String(const char *str); String(const String &other); String & operator=(const String &other); ~Str原创 2016-04-29 21:48:24 · 190 阅读 · 0 评论 -
关键代码段(临界区)实现线程死锁
#include #include DWORD WINAPI Fun1Proc( LPVOID lpParameter // thread data ); DWORD WINAPI Fun2Proc( LPVOID lpParameter // thread data ); int tickets=100; CRITICAL_SECTION g_csA; C转载 2016-04-29 21:46:54 · 640 阅读 · 0 评论 -
操作符重载及友元函数
#include using namespace std; class Students { private: int age; int weigth; public: Students(); Students(int age,int weigth); Students operator+(const Students &stu) const; friend vo原创 2016-04-29 20:06:58 · 285 阅读 · 0 评论 -
istringstream用法
//istringstream对象可以绑定一行字符串,然后以空格为分隔符把该行分隔开来 #include #include #include//头文件 using namespace std; void main() { string str; while(getline(cin,str)) { std::istringstream tmpStream(str);原创 2016-04-29 20:04:12 · 436 阅读 · 0 评论 -
Android手机震动
package com.example.vibrate; import android.app.Activity; import android.app.Service; import android.os.Bundle; import android.os.Vibrator; import android.view.Menu; import android.view.MenuItem原创 2016-04-29 20:00:47 · 318 阅读 · 0 评论 -
查找某一目录下的所有文件名
#include #include #include #include #include using namespace std; vector pathList; void GetFilePath(string path) { struct _finddata_t fileInfo; long hFile = 0; string fileName; string原创 2016-04-29 19:56:44 · 488 阅读 · 0 评论 -
CArchive类基本读写
#include #include using namespace std; void ArchiveRead() { CFile file("C:\\Users\\Administrator\\Desktop\\test.txt",CFile::modeRead); CArchive ar(&file,CArchive::load); int i; char ch;原创 2016-04-29 19:53:41 · 1010 阅读 · 0 评论 -
C++中多字节与双字节的字符的转换
#include #include #include using namespace std; void c2w(const char *pchar, wchar_t *pwchar,int len) { int clen = strlen(pchar) + 1; int wclen = MultiByteToWideChar(0,0,pchar,clen,NULL,0);原创 2016-04-29 19:51:17 · 2442 阅读 · 0 评论 -
配置文件的读写
#include #include using namespace std; typedef struct school { char name[20]; int time; }; void main() { char *filePath = "C:\\Users\\Administrator\\Desktop\\config.ini"; int age; cha原创 2016-04-29 19:45:54 · 236 阅读 · 0 评论 -
事件对象实现线程同步
#include #include DWORD WINAPI Fun1Proc( LPVOID lpParameter // thread data ); DWORD WINAPI Fun2Proc( LPVOID lpParameter // thread data ); int tickets=100; HANDLE g_hEvent; void mai原创 2016-04-29 21:57:59 · 271 阅读 · 0 评论