cancel
Showing results for 
Search instead for 
Did you mean: 

Borland C++ - RFC_INVALID_PARAMETERS - Unicode Problem?

vritzau
Participant
0 Kudos

Hi,

we use the Borland C++ IDE for some interfaces with "legacy" programs.

We tried to call an RFC to SAP System, and followed the instructions to download and install sapnwrfc.dll described in the respective notes (e.g. 1097997 - SAP NW RFC SDK auf system i installieren)

When calling the System-Login (RfcOpenConnection) we always get a RFC_INVALID_PARAMETER error.

In this thread I found the hint that it could be a UNICODE Problem.

So we tried to check the cU Makro which is used in sapuc.h.

/*----------------------------------------------------------------------------
 * sapuc.h  -  character constants and string constants
 *---------------------------------------------------------------------------*/
#define cNtoS(par)      cNtoS_HELP( par )
#define cNtoS_HELP(par) #par

#define cR(par)         par

#ifndef SAPwithUNICODE
  #define cU(par)       par
  #define iU(par)       par

#else /* SAPwithUNICODE */
  #define cU(par)         cU16(par)
  #define iU(par)         iU16(par)

#endif

But this macro seems not to work with the Borland C++.

When we try to add the parameters described in note: Hinweis 1056696 - RFC-Programme kompilieren und mit SAP NW RFC SDK verknüpfen, like SAPwithUNICODE to the compiler, the programm won't be compiled and several errors occur.

Can someone tell me what to do or does anybody know if the Borland C++ compiler cannot be used with the sapnwrfc.dll.

Is there a workaround?

Best regards

Volker Ritzau

Edited by: Volker Ritzau on Jan 13, 2012 2:24 PM

The Borland C++ Compiler ist this Version:

Borland© C++ Builder® für Microsoft® Windowsu2122

10.0.2288.42451 Update 2 Copyright © 2005 Borland® Software

Corporation. Alle Rechte vorbehalten.

Edited by: Volker Ritzau on Jan 12, 2012 6:05 PM

Accepted Solutions (1)

Accepted Solutions (1)

vritzau
Participant
0 Kudos

Workaround with wchar_t as described in note works.

Hinweis 1056696:

o  Windows

   Microsoft Visual Studio 2005 SP1

   When using Microsoft Visual Studio 2008, please note the

   following limitation: the functions from libsapucum.dll (sapuc.h)

   cannot be used with VS 2008. Instead of these functions use the

   standard Microsoft w-functions (wchar.h). (On Windows the

   datatype "SAP_UC" is equivalent to "wchar_t".) For example,

   instead of printfU() use wprintf(), instead of getcU() use

   _getws().

Former Member
0 Kudos

Hey,

it's a little bit off topic but I have a problem with linking the NW RFC dlls to a borland c++ project. I've generated the .lib-files with implib. Compiling the project is possible, but when I start the program it hangs completely. After that I tried to load the DLL directly with LoadLibrary.. but again the program freezes.

Do you have any idea what could be wrong?

Best Regards and thanks in advance,

Mario

Answers (0)