随笔分类 -  Windows

NTSTATUS code 和 Windows 系统错误码 的对应关系
摘要:出处:https://github.com/dokan-dev/dokany/blob/master/dokan/ntstatus.i 阅读全文

posted @ 2019-03-15 15:39 liujx2019 阅读(794) 评论(0) 推荐(0)

用互斥锁实现程序只能有一个实例
摘要:HANDLE mSingleInstanceMutex = NULL; bool moreThanOneInstance() { mSingleInstanceMutex = CreateMutex(NULL, FALSE, L"SingleNFDLinkGUI"); if (NULL == mSingleInstanceMutex || ERROR_ALREADY_EXIST... 阅读全文

posted @ 2019-02-28 15:54 liujx2019 阅读(341) 评论(0) 推荐(0)

Visual Studio 2015 + Windows 2012 R2, c++/cli Array::Sort() 抛出异常
摘要:在Windows7上编译就是正常。 可见Windows2012 R2缺少了一些东西。 另外,有一个现象一样,但原因不一样的 https://stackoverflow.com/questions/4641715/c-cli-application-crashing-randomly-on-relea 阅读全文

posted @ 2019-02-28 15:47 liujx2019 阅读(232) 评论(0) 推荐(0)

阻塞 非阻塞
摘要:阻塞的系统调用是指, 当进行系统调用时, 除非出错(被信号打断也视为出错) , 进程将会一直陷入内核态直到调用完成。 非阻塞的系统调用是指无论I/O操作成功与否, 调用都会立刻返回 阅读全文

posted @ 2019-01-23 16:54 liujx2019 阅读(105) 评论(0) 推荐(0)

QT 执行windows cmd 命令并读取结果
摘要:1,写好命令, 2,用QProcess执行,等待完成(有超时), 3,读取结果 注意形如“Program Files”的有 空格 的路径,要加上双引号。 阅读全文

posted @ 2019-01-23 16:42 liujx2019 阅读(3139) 评论(0) 推荐(0)

获取磁盘的 总容量,空余容量,已用容量 【windows】
摘要:使用windows api 输入:盘符字符串 输出:磁盘容量 注意其中的字符数组 dir 一定要以'\0'结尾,否则程序时好时坏,因为有时dir末尾正好是0,而有时不是。 阅读全文

posted @ 2019-01-23 16:40 liujx2019 阅读(440) 评论(0) 推荐(0)

通过进程名称,获取其路径
摘要:使用windows api 此处要轮询每个进程,稍微费时,不适合几秒钟就做一次的情况 阅读全文

posted @ 2019-01-23 16:39 liujx2019 阅读(307) 评论(0) 推荐(0)

C++ Windows - How to get process path from its PID
摘要:出处 https://stackoverflow.com/questions/1933113/c-windows-how-to-get-process-path-from-its-pid 注意质疑(我也没试过): 1 most of modules turn to a failure in gett 阅读全文

posted @ 2019-01-23 16:38 liujx2019 阅读(826) 评论(0) 推荐(0)

QT 无法抓住异常
摘要:出处:https://stackoverflow.com/questions/40980171/qt5core-dll-crashing I've found that enabling /EHa (Structured Exception Handling) on the compiler sol 阅读全文

posted @ 2019-01-23 16:37 liujx2019 阅读(1364) 评论(0) 推荐(0)

设置共享内存大小 【windows】
摘要:hMapFile = CreateFileMapping( INVALID_HANDLE_VALUE, // use paging file NULL, // default security PAGE_READWRITE, //... 阅读全文

posted @ 2019-01-23 16:36 liujx2019 阅读(1448) 评论(0) 推荐(1)

How to use QueryPerformanceCounter? (c++,不使用 .Net)
摘要:出处:https://stackoverflow.com/questions/1739259/how-to-use-queryperformancecounter 参考:https://docs.microsoft.com/zh-cn/windows/desktop/WmiSdk/accessing 阅读全文

posted @ 2019-01-23 16:35 liujx2019 阅读(291) 评论(0) 推荐(0)

c++ 更新 performance counter 数据,错误码 87
摘要:ERROR_INVALID_PARAMETER 87 (0x57) The parameter is incorrect. 很可能是该送 ULONG 的送了 ULONGLONG,vise versa ERROR_INVALID_PARAMETER 87 (0x57) The parameter is 阅读全文

posted @ 2019-01-23 16:35 liujx2019 阅读(238) 评论(0) 推荐(0)

fseek 在以字符串模式打开的文件中工作不正常 [MSDN]
摘要:For streams opened in text mode, fseek and _fseeki64 have limited use, because carriage return-linefeed translations can cause fseek and _fseeki64 to 阅读全文

posted @ 2019-01-23 16:28 liujx2019 阅读(170) 评论(0) 推荐(0)

Visual Studio 添加图标和版本
摘要:在Visual Studio中,如果你创建的是纯C语言的工程,那么给可执行程序添加图标就没有便捷的入口。 但也只是入口不好找了,添加步骤还是比较简单的,以下为具体操作方法: 1. 右键点击C工程,选择Add->Resource去添加图标。 2. 在弹出的菜单中选Icon,并点击新建 Note:注意看 阅读全文

posted @ 2019-01-23 10:08 liujx2019 阅读(10711) 评论(0) 推荐(2)

Configure Visual Studio with UNIX end of lines
摘要:As OP states "File > Advanced Save Options", select Unix Line Endings. https://stackoverflow.com/questions/3802406/configure-visual-studio-with-unix-e 阅读全文

posted @ 2019-01-21 11:35 liujx2019 阅读(282) 评论(0) 推荐(0)

导航