- 博客(12)
- 资源 (54)
- 收藏
- 关注
原创 dll 二次封装
需要用到二次封装,其实很简单,不过在第二个dll调用第一个dll的方法而已。 笔记下以免忘了。 //dll1.h:#ifndef _dll1_h#define _dll1_h#define MYDLL extern "C" _declspec (dllexport)MYDLL int add(int x,int y);#endif //_dll1_h//dll1.cpp#include
2016-04-22 14:51:34 4187
转载 GetProcAddress 出错,返回NULL(127)
GetProcAddress 出错,返回NULL(getlasterror返回:127—找不到指定的程序).dll中加入 extern “C” 即可。
2016-04-19 16:16:39 8333
原创 CreateProcess 终止进程
最近需要用到,稍微研究了下。 1. 供CreateProcess启动的进程,只是打印出参数而已。#include "stdafx.h"#include <stdlib.h>#include <iostream>#include <string>using namespace std;int main(int argc, char* argv[]){ cout<<"Args
2016-04-19 13:52:42 4282
原创 Cuda dll封装
新建Cuda工程 –Cuda 7.5 Runtime项目-右键属性-配置属性 修改配置类型为dll,好像也不需要。添加一个头文件和一个cpp文件。 test.h test.cpp test.h :#ifndef CUDA_TEST_H#define CUDA_TEST_H__declspec(dllexport) int GetGPUCount(void);#endif test.
2016-04-13 11:02:17 3617 1
原创 Cuda Test
新建C++ 控制台项目添加包含路径和库路径。cuda\v7.5\include;cuda\v7.5\lib\x64;(我的是64位机器)代码如下:#include "stdafx.h"#include <cuda_runtime.h>#pragma comment(lib,"cuda_static.lib")int main(int argc,_TCHAR* argv[]){ i
2016-04-13 09:49:05 873
原创 Boost 入门之3 - 测量时间流逝
#include <Windows.h>#include <iostream>using namespace std;#include <boost/timer.hpp>#include <boost/progress.hpp>using namespace boost;int main(int argc, char* argv[]){ timer t; Sleep(1
2016-04-08 11:41:05 630
原创 Boost 入门之3 - 格式化
// boost_.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include <stdlib.h>#include <iostream>#include <boost/format.hpp>using namespace std;//类似c的sprintf,MFC的Format.int _tmain() { cout << boost:
2016-04-08 11:33:51 1066
原创 Boost 入门之2 - 类型转换
相当于atio,aof.#include "stdafx.h"#include <iostream>#inlcude <string>using namespace std;#include <boost\lexical_cast.hpp>using namespace boost;int _tmain(int argc,_TCHAR* argv[]){ int i = 888;
2016-04-08 10:45:13 566
原创 不具名的命名空间(unnamed namespaces)
众所周知,命名空间是用来防止对象的重复定义的。 如下,编译不会出错:namespace n1{ int x;}namespace n2{ int x;}//访问n1.x;n2.x;上面是具名的名字空间,不具名的名字空间也是防止对象重复定义用,只是他没有名字而已。file1.cpp:namespace { //变量x和方法fun只在file1.cpp可见
2016-04-06 11:09:29 5279
原创 Protobuf 入门
下载 https://sourceforge.net/projects/protobuf/?source protobuf-2.6.0.zip https://github.com/google/protobuf 编译 解压,打开protobuf.sln,编译生成库文件(libprotoc.lib,libprotobuf.lib)和编译器 (protoc.exe). (只用生成libpr
2016-04-05 14:25:00 1474
原创 windows 文件描述符
在类Unix系统下用文件描述符descriptor来访问文件。文件描述符是非负整数。打开现存文件或新建文件时,内核会返回一个文件描述符。读写文件也需要使用文件描述符来指定待读写的文件。如下: int fileDescripter = fopen("fileName",O_RDONLY);Windows下一般(最基本的)用fopen访问文件。 FILE * fp = fopen("fi
2016-04-05 10:12:48 4651
原创 c++ 复数类
测试而已,不完整。 complex.h#ifndef _COMPLEX_H#define _COMPLEX_Hclass complex{ public://构造函数 complex():_real(0),_imag(0){} complex(double real):_real(real),_imag(0){} complex(doub
2016-04-02 10:11:37 640
Agilent Technologies EMC Series Spectrum Analyzers
2013-12-21
VC,.BCB串口通讯代码
2012-12-12
WinPcap中文技术文档.chm
2011-09-20
RiftDK1源码
2016-10-26
支持win7 64位的hex2bin程序(v2.2)
2016-09-27
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人