c++
文章平均质量分 59
不习惯的记忆
这个作者很懒,什么都没留下…
展开
-
微信企业会话存档SDK接口封装(Python示例)
Windows平台win10vs2019sdk_win_v1.1export.cppextern "C"{#include <malloc.h>#include <string.h>#include <stdio.h>#include "WeWorkFinanceSdk_C.h" WeWorkFinanceSdk_t* sdk = NewSdk(); __declspec(dllexport) void free_p(void*原创 2022-01-13 13:54:06 · 1724 阅读 · 14 评论 -
window+vs2015+mosquitto+websockets 编译&使用
Windows平台准备模块:github mosquittogithub libwebsocket git clone https://libwebsockets.org/repo/libwebsocketspthreadopenssslvs2015cmake过程解压,安装pthread 和openssl, pthread 选择的Prebuilt.2,32位版本, openssl1_1_1,32位版本;cmake libwebsocket,原创 2021-11-12 17:18:23 · 921 阅读 · 0 评论 -
c++ 一个简单的页面置换实现
template <typename T>struct CacheSequence{public: CacheSequence(const int seq_len) { _seq_len = seq_len; } void AddCache(const std::string& key, const T& val) { if (_cache_...原创 2018-06-20 12:05:44 · 430 阅读 · 0 评论 -
Google地图上任意两个点的距离
公式:float CalcDistanceOfTwoPoints( const double& x1, const double& y1, const double& x2, const double& y2){ // s = arcsin() double a = y2 - y1; double b = x2 - x1; //google:地图上任意两点的距离公式 re原创 2017-12-08 10:39:06 · 381 阅读 · 0 评论 -
c++ trim 去字符串空格
现在麻烦的是每次用完需要free,其他方面都还行。char* trim_c(char* src, bool left = true, bool right = true, bool all = false){#ifndef SPACE_CHAR#define SPACE_CHAR ' '#define END_OF_CHAR '\0'#endif size_t src_len =原创 2017-12-11 19:38:15 · 1722 阅读 · 0 评论 -
openssl + mosquitto + windows (x64)
mosquitto:安装 openssl x64:安装mosquitto支持openssl所依赖的DLL参考 mosquitto/readme.txt的内容。cd .../openssl/bin (TODO:)生成CA证书:openssl genrsa -out ca/ca-key.pem 1024原创 2017-06-15 14:49:12 · 1398 阅读 · 2 评论 -
boost::filesystem 常用方法
点击打开链接转载 2017-05-19 18:45:59 · 442 阅读 · 0 评论 -
c++ dll 单例模式出现多个单例对象
源url: http://www.cnblogs.com/bourneli/archive/2011/12/28/2305280.html我这里的问题主要是这样的:有三个project, Project1, Project2, ProjectTest. Project2 依赖于Project1,并且在project2 中 存在project1 中一个单例类的实例。project1:转载 2017-05-17 16:09:08 · 4472 阅读 · 0 评论 -
extern "C" __declspec(dllexport) 用法
declspec(dllexport)和使用.def文件是有区别的。如果DLL是提供给VC++用户使用的,你只需要把编译DLL时产生的.lib提供给用户,它可以很轻松地调用你的DLL。但是如果你的DLL是供其他程序如VB、delphi,以及.NET用户使用的,那么会产生一个小麻烦。因为VC++对于__declspec(dllexport)声明的函数会对函数名尾附加函数在DLL中的地址,如下面的函数转载 2017-05-15 11:45:31 · 4752 阅读 · 0 评论