Quantcast
Channel: SCN : All Content - SAP NetWeaver Technology Platform
Viewing all articles
Browse latest Browse all 1967

Access violation using SAP NW RFC SDK

$
0
0

Hello,

 

I just got the SAP NW RFC SDK from the marketplace (Windows Server IA32 32bit).

 

I created a new console application using Visual Studio 2010.

 

I added the include and lib folder from the extracted archive to the VC++ Directories (include and lib directory).

Then I added sapnwrfc.lib to the additional dependencies to linker->input.

 

I used the following code from the example:

 

#include "stdafx.h"
#include <sapnwrfc.h>

int _tmain(int argc, _TCHAR* argv[])
{

    RFC_RC rc = RFC_OK;    RFC_ERROR_INFO error;    memsetR(&error, 0, sizeofR(RFC_ERROR_INFO));    RFC_CONNECTION_PARAMETER connParams[] = {                                {cU("ashost"), cU("")},                                {cU("sysnr"), cU("")},                                {cU("client"), cU("")},                                {cU("lang"), cU("") ? cU("") : cU("E")},                                {cU("user"), cU("")},                                {cU("passwd"), cU("")},                                {cU("dest"), cU("") ? cU("") : cU("")}};    RFC_CONNECTION_HANDLE connHandle = RfcOpenConnection(connParams,                                         sizeofR(connParams) / sizeofR(RFC_CONNECTION_PARAMETER),                                        &error);    if(connHandle){    }    return 0;
}

 

So far the program compiles ok. I copied the .dll files to the debug folder and started the application. At the moment the method RfcOpenConnection is called I get the following message:

 

Unhandeled exception at 0x7c93a958 in SAPRFC.exe: 0xC0000005: Access violation while writing to position 0x00040ff8.

 

Can anybody help me what I did wrong? As far as I see there should be everything fine. Could it be that the SAP NW RFC SDK is incompatible with Visual Studio 2010 and the toolset v100?

 

 

Kind regards,

Michael

 

Edited by: Michael Belz on Nov 25, 2011 2:56 PM


Viewing all articles
Browse latest Browse all 1967

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>