Re: Business Function for String Manipulation

smssharma

Member
Re: Business Function for String Manipulation

I am also not a c programmer but probably you do not have c++ installed o=
n your machine.


On Thu, 06 Sep 2001 [email protected] wrote :


















=
 
Re: Business Function for String Manipulation

The original post. . . .

****************************************
I (non "C" programmer) have a need to parse Media Object Text. I created a
business function to accept the media text as an input parameter along with
a delimiter value. The business function will not build because of the
following error. Any ideas on how to do this ?
jdertdll.c
B5517001.c
C:\Program Files\Microsoft Visual Studio\VC98\include\eh.h(32) : fatal error
C1189: #error : "eh.h is only for C++!"

Here's an extract of the source code:
#include <string>
using std::string;

// Variables
string s1, s2;
int startPos, endPos;

// Main
string s1( lpDS-> MediaObjectVariableLengthC );
startPos = s1.find( lpDS->szFunctionCode );
endPos = s1.find( lpDS->szFunctionCode_2, startPos + 1 );
s2 = s1.substr( (startPos + 3), (endPos - (startPos + 3)) );
lpDS->szCurrentText = s2;

Regards,
Derek
xe sp16 as400 v4r5
*************************************

This doesn't work because it's all C++ code. OneWorld BSFNs all have to be plain ANSI C. You can get away with WIN32 code in many cases, but that's still just C, not C++. I suspect you copied this from a C++ book, so I recommend you get hold of a C book to copy from instead. "Plagiarism" is the programmers mantra by the way, so there's no shame in copying out of a book.

Darren Ricciardi - OneWorld Whipping Boy

Looking for work in OR NEAR Amsterdam THE NETHERLANDS
 
Back
Top