SAP Netweaver.C++ 错误:无法读取内存
SAP Netweaver. C++ Error:The memory cannot be read
对于我的项目,我需要测试路由器字符串是否使用 SAP Netweaver 7.0 成功连接到 SAP 服务器。我在Visual Studio 2017中创建了一个控制台应用程序。我已经给出了连接参数。但应用程序以错误结束:无法读取内存
#include <stdlib.h>
#include <stdio.h>
#include "stdafx.h"
#include "include/sapnwrfc.h"
void errorHandling(RFC_RC rc, RFC_ERROR_INFO*errorInfo, RFC_CONNECTION_HANDLE connection) {
printfU(cU("%s: %sn"), errorInfo->key, errorInfo->message);
/* It's better to close the TCP/IP connection cleanly, than tojust let the backend get a "Connection reset by peer" error...*/
if (connection != NULL) RfcCloseConnection(connection, errorInfo);
exit(1);
}
int mainU(int argc, SAP_UC** argv)
{
RFC_RC rc = RFC_OK;
RFC_CONNECTION_PARAMETER loginParams[6];
RFC_ERROR_INFO errorInfo;
RFC_CONNECTION_HANDLE connection;
// -----------------------------------------------
// OPEN CONNECTION
// -----------------------------------------------
// Create logon parameter list
loginParams[0].name = cU("gwhost");
loginParams[0].value = cU("80.**.***.**");
loginParams[1].name = cU("sysnr");
loginParams[1].value = cU("00");
loginParams[2].name = cU("client");
loginParams[2].value = cU("800");
loginParams[3].name = cU("user");
loginParams[3].value = cU("jsar12");
loginParams[4].name = cU("lang");
loginParams[4].value = cU("EN");
loginParams[5].name = cU("****");
loginParams[5].value = cU("Abc");
// Open connection
connection = RfcOpenConnection(loginParams, 6, &errorInfo);
if (connection == NULL) errorHandling(rc, &errorInfo, NULL);
return 0;
}
预期结果: 连接到 SAP 路由器
上述问题的解决方案是在Visual Studio的设置中。经过大量搜索和尝试了一些技巧,我在以下链接中找到了解决方案:https://answers.sap.com/questions/12367200/netweaver-rfc-connector-error-logon.html
总结:
On Linux and Windows, certain minimum releases of the C runtime are required to execute the programs. See SAP Notes 1021236 (for Linux) and 684106 (for Windows). The compiler and linker options needed to compile programs using the SAP NetWeaver RFC SDK are listed in SAP Note 1056696.
In addition, for Windows users using Microsoft Visual Studio, this is a description of how to set the Visual Studio project properties:
General section: Make sure the CharacterSet field is set to “Use Unicode Character Set.”
Debugging section: Under Environment, add something like Path=%Path%;nwrfcsdklib.
C/C++ section:
General: Add the nwrfcsdkinclude directory under Additional Include Directories.
Preprocessor: Add the two preprocessor definitions SAPonNT and SAPwithUNICODE.
Code Generation: Choose “Multi-threaded DLL (/MD)” as the Runtime Library; selecting “Multi-threaded Debug DLL (/MDd)” may lead to strange problems.
Linker section:
General: Add the nwrfcsdklib directory under Additional Library Directories.
Input: Under Additional Dependencies, add libsapucum.lib, sapnwrfc.lib, and sapdecfICUlib.lib
相关文章:
- 我可以在没有任何锁的情况下从不同的线程读取内存缓冲区吗?
- SAP Netweaver.C++ 错误:无法读取内存
- c++ 结构指针在初始化为 NULL 时无法读取内存
- GDB Python模块读取内存内容
- 内存池和<无法读取内存>
- 读取内存值(实时)最佳实践
- C++无法读取内存地址
- 构造函数问题<无法读取内存>
- C 螺纹池具有共享仅读取内存
- C++ 读取内存地址/指针和偏移量
- C++字符串无法读取内存
- 调用函数时,c++无法使用自定义类读取内存
- 无法读取内存以删除对象数组
- ConstantStruct或ConstantArray读取内存内容
- 如何在可视C++中读取内存地址
- C++:从注入的DLL读取内存的好方法是什么?
- C++ 对象的实例无法读取内存
- <无法读取内存> c++
- 内核驱动程序读取内存未发送整个字符串
- 在C++中嵌入 Python 的错误:无法读取内存