RE: C function problem
Posted in 1999
(It helps to know what version of ewverything you are using, btw) make sure the type of string your function returns is mi_lvarchar your prototype should look like mi_lvarchar *foo(...) then make sure you convert the string in C to a mi_lvarchar before you return it with the call char *myString; mi_lvarhcar *returnMe; ... returnMe = mi_string_to_lvarchar(myString); free(string); return returnMe; (We assume the server automatically frees the memory pointed to by returnMe after the function returns.) We do it all the time here and it works fine on IUS 9.14, Solaris 2.5.1. Let me know if you still have problems. - Thomas Tatum 919-767-2129 ______________________________________________________________________ Stay connected with family and friends this holiday season and year-round with a FREE, easy-to-use Family Web Site. No HTML required! http://www.familyshoebox.com > -----Original Message----- > From: owner-informix-list@iiug.org > [mailto:owner-informix-list@iiug.org]On Behalf Of rene@ibw.nl > Sent: Tuesday, January 12, 1999 5:55 AM > To: informix-list@iiug.org > Subject: C function problem > > > Hello > > I have made a C function that takes an argument string and returns a > converted string. I have compiled and linked the function to a > shared object > (a .so file). I declared the function using the DECLARE FUNCTION statement > and now I want to use this function in informix using 'execute > function xxxx > (parameter);'. The function executes, but it returns nothing. > Informix comes > up with an error 'Bad UDR return pointer', so I guess I am doing something > wrong within the C function (which returns a pointer to the > result string). I > have run out of ideas by now....can anyone help me here, or give me some > examples of using C functions with Informix. > > -----------== Posted via Deja News, The Discussion Network ==---------- > http://www.dejanews.com/ Search, Read, Discuss, or Start > Your Own >