c++
internal_functions
这个作者很懒,什么都没留下…
展开
-
C++获得本地机IP(windows下 VS环境)
//获得[本机IP]------------------------------301---[begin] char szText[256]; //获取本机主机名称 int iRet; iRet = gethostname(szText, 256); int a = WSAGetLastError(); if (iRet != 0) {...原创 2019-12-24 17:35:08 · 348 阅读 · 0 评论 -
C++ 得到当前进程ID
#include <stdio.h>#include <process.h>int main( void ){/* If run froom command line, shows different ID for* command line than for operating system shell.*/printf( "Process i...原创 2019-12-24 11:06:57 · 2048 阅读 · 0 评论 -
C++ 判断某名称的进程是否存在的代码
#include <tlhelp32.h> //判断进程是否存在[头文件]DWORD GetProcessidFromName(LPCTSTR name) //判断进程是否存在{ PROCESSENTRY32 pe; DWORD id = 0; HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SN...原创 2019-12-23 14:48:19 · 947 阅读 · 0 评论 -
C++ 不转义字符的方法实例
R"+*(内容)+*"; //不转义字符原封不动的字符串方法eg:std::string l_tmp;l_tmp=R"+*(\asd\asdasd\asdasdasd\asdasdas\asdasd\\\ascas)+*";其输出就是:\asd\asdasd\asdasdasd\asdasdas\asdasd\\\ascas...原创 2019-12-13 14:10:45 · 3267 阅读 · 1 评论 -
Windows系统下得到当前本进程id
#ifdef _WIN32#include <process.h>#else#include <unistd.h>#endifint main(){ int iPid = (int)getpid(); std::cout<<"The process id is: "<<iPid<<std:...原创 2019-12-09 15:45:22 · 371 阅读 · 0 评论 -
C++ string与int, float, double相互转换实列
#include <iostream> #include <sstream> //使用stringstream需要引入这个头文件 using namespace std; //模板函数:将string类型变量转换为常用的数值类型(此方法具有普遍适用性) template <class Type> Type stringToNu...原创 2019-12-05 10:39:58 · 148 阅读 · 0 评论 -
ocx控件注册和注销等使用相关
注册方式ocx控件的安装方式有很多种,这里介绍最简单的一种。步骤:1.进入开始,点击运行。2.在出现的框中键入regsvr32 C:\xxxx.ocx 。(XXXX为控件名, C:\为目录))([eg]例子:regsvr32 E:\控件的制作\myOcxTest\Debug\myOcxTest.ocx)3.点击确认后等待出现提醒注册成功即可。oca 文件Oca文件...原创 2019-11-01 10:25:21 · 1022 阅读 · 0 评论