- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在尝试编写一个 C++ DLL,它使用 openSSL 来保护与服务器的连接。
我真的很困惑这个代码
#include "stdafx.h"
#include <string.h>
#include <iostream>
//SSL stuff
#include <openssl/ssl.h>
#include <openssl/err.h>
#include <openssl/pem.h>
#include <openssl/x509.h>
#include <openssl/x509_vfy.h>
#include <openssl/ossl_typ.h>
#include <openssl/applink.c>
//Winsock stuf
#pragma comment(lib, "ws2_32.lib")
{... Create a method in which we set up the SSL connection ...}
char* tSend = "{\"reqtype\":\"keyexchange\"}";
int sendSize = strlen(tSend);
int net_tSend = htonl(sendSize);
SSL_write(ssl, &net_tSend, 4);
SSL_write(ssl, tSend, sendSize);
在控制台应用程序中工作正常,但在我的 DLL 中崩溃。这是我的异常(exception):
Exception thrown at 0x00007FF865207DA0 (libeay32.dll) in TestsForPKCSDLL.exe: 0xC0000005: Access violation reading location 0x0000000000000000.
非常感谢您的宝贵时间。
最佳答案
经过一些研究,问题似乎出在 htonl() 函数上。
u_long mylong = 10L;
int net_tSend = htonl(mylong);
Exception thrown at 0x00007FF863807DA0 (libeay32.dll) in TestsForPKCSDLL.exe: 0xC0000005: Access violation reading location 0x0000000000000000.
显然没有正确加载。我认为,因为我的代码在 DLL 中,如果调用程序不引用 SSL dll,它就会崩溃。我将尝试静态链接 libeay32 和 ssleay32,看看是否可行。
关于c++ - VisualC++ DLL 中的 OpenSSL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36704926/
我在 visualstudio2010 上使用 opencv2.1 调试时显示此错误消息: '程序无法启动,因为您的计算机缺少 cxcore210.dll。尝试重新安装程序以修复此程序。' 但 cxc
1 问题描述 1.1 内存泄漏的困扰和解决之道 在C/C++程序开发过程中,开发者受益于C/C++的强大,与此同时也承受着C/C++程序开发的额外风险。像Java、C#这类带GC(内存垃圾回收)的
我的目标是检查 Sheet1 中的每一行,以便发现有多少行,所以我放了一个 do\while,一旦它到达一个空白单元格就应该停止 例子: row1 data row2 data row3 data r
我正在尝试使用 VC2010 项目引用,它替代了旧的“项目依赖项”对话框。然而,我缺少的是一种让引用项目继承被引用项目的包含和库路径的方法。现在,我必须手动复制我在引用项目中设置的任何额外路径。 有什
我正在尝试编写一个 C++ DLL,它使用 openSSL 来保护与服务器的连接。 我真的很困惑这个代码 #include "stdafx.h" #include #include //SSL s
顺便说一句,我是 Visual C# 的新手。 我已经有了要上传的.txt文件,但是在我熟悉Visual C#之后,我的最终目标是上传一个.txt文件到内存中,读取它,解析它上面的数据字符串的某些部分
此站点上有几个问题询问是否可以使用 volatile 变量进行原子/多线程访问:参见 here , here , or here例如。 现在,符合 C(++) 标准的答案显然是否。 但是,在 Wind
我正在尝试设置 VC++ 以编译具有 OpenGL 4.1 功能的代码。我从 opengl.org 下载了 3 个头文件;将它们放在正确的路径中并包含它们 - 但不断出现这样的错误: error C3
struct mystruct { using this_class = mystruct; /* old typedef such as: typedef
我想将应用程序的插件编译为动态库。通常,插件是用 VisualC++ 编译的,但我想使用 G++。 SDK 文档明确指出 The compiler options for Pointer-to-mem
我使用的是 Windows 8 64 位和 Visual C++ 2012 Express。我偶然发现使用 WDK 8 的程序只能使用专业及以上版本构建。现在还是这样吗?无论如何,我真的很想学习它,所
我正在尝试将使用可视化工具包 (VTK) 库创建的场景嵌入到 VisualC++ 2012 创建的 Windows 窗体中,以便我可以设计我的 Windows native GUI 界面。 我想强调的
我是 Linux 的长期用户和“高级”Python 程序员。我最近在周末有一些空闲时间,我开始学习 C++。 我正在使用 Qt Creator 进行开发,因为它具有很好的功能,而且简单、快速,我还计划
我在添加一个带有 node_modules 文件夹的项目后尝试编译我的 ASP.NET MVC 项目,它给了我以下错误: The CodeDom provider type "Microsoft.Vi
我正在构建服务器中构建/打包 Web 应用程序,但失败并显示以下消息: ASPNETCOMPILER error ASPCONFIG: The CodeDom provider type "Micro
我必须就我们是否应该花额外的钱购买配备 Intel i7 CPU(i7 950s)的新计算机,或者我们是否应该购买 Intel Core 2 Quad 处理器(Q9550s 或同等产品)向管理层提出建
我是一名优秀的程序员,十分优秀!