I already fixed the code so I will have to reproduce it. I will try to put a package together and post it later today.
David Ashley On 01/08/2010 10:12 AM, Rick McGuire wrote: > I'd like to see the exact error message when you try to do this. An > int * can most certainly be cast to a char * in C++. And you can > generally get around this by doing (char *)(void *) in the casts. I > suspect there's something else going on here, which is why I'd like to > see the exact error message. > > Rick > > On Fri, Jan 8, 2010 at 11:08 AM, David Ashley > <[email protected]> wrote: > >> Hummm..... >> >> CSTRING has always implied to me that a null-terminated buffer is being >> specified. That may be a wrong assumption on my part but that is what I >> thought. >> >> In any case the compiler complains when the buffer specified to >> NewString is NOT a char * type. For instance, in my case it is an array >> of int types (int *). No matter how I try to force a type cast the >> compiler complains that it can not convert a int* to a char*. This is >> not a warning, it is a complier error message. >> >> This is why I take issue with CSTRING as the type for the first arg to >> NewString with a length specified. The compiler will not allow just any >> data type to be specified for the first argument. A void* type would >> allow any data types to be specified. >> >> David Ashley >> >> On 01/08/2010 09:56 AM, Rick McGuire wrote: >> >>> A CSTRING type is not an ASCII-Z string, it really just a const char * >>> type. What is the compiler error when you do the cast? Have you >>> tried using CSTRING for the cast type when you make the call? >>> >>> Rick >>> >>> On Fri, Jan 8, 2010 at 10:31 AM, David Ashley >>> <[email protected]> wrote: >>> >>> >>>> Ok, Rick's suggestion to use BufferString instead works just fine. >>>> >>>> But, I do take issue with the API method >>>> >>>> RexxStringObject NewString(CSTRING s, size_t len) >>>> >>>> Since a size for the string is being specified and embedded nulls will >>>> be ignored the CSTRING type is not appropriate for the signature. I >>>> believe it should be void* instead. >>>> >>>> David Ashley >>>> >>>> On 01/07/2010 07:39 PM, Rick McGuire wrote: >>>> >>>> >>>>> Umm, there is a String conversion method that takes a length as well. >>>>> Also, if you can predict the maximum length ahead of time, you can >>>>> allocate a BufferString, read the data directly into the buffer string >>>>> and than convert this into a true string using the appopriate length. >>>>> The charin() function works this way if you'd like an example. >>>>> >>>>> Rick >>>>> >>>>> On Thu, Jan 7, 2010 at 7:11 PM, David Ashley<[email protected]> >>>>> wrote: >>>>> >>>>> >>>>> >>>>>> Rick/Mark - >>>>>> >>>>>> I have come across a problem using the new C++ API. I have a buffer of >>>>>> data that I want to return from a method as a RexxString. The problem is >>>>>> that this buffer may contain embedded nulls, thus none of the >>>>>> String/CSTRING methods will work for the conversion. Is there a way to >>>>>> do this? >>>>>> >>>>>> David Ashley >>>>>> >>>>>> ------------------------------------------------------------------------------ >>>>>> This SF.Net email is sponsored by the Verizon Developer Community >>>>>> Take advantage of Verizon's best-in-class app development support >>>>>> A streamlined, 14 day to market process makes app distribution fast and >>>>>> easy >>>>>> Join now and get one step closer to millions of Verizon customers >>>>>> http://p.sf.net/sfu/verizon-dev2dev >>>>>> _______________________________________________ >>>>>> Oorexx-devel mailing list >>>>>> [email protected] >>>>>> https://lists.sourceforge.net/lists/listinfo/oorexx-devel >>>>>> >>>>>> >>>>>> >>>>>> >>>>> ------------------------------------------------------------------------------ >>>>> This SF.Net email is sponsored by the Verizon Developer Community >>>>> Take advantage of Verizon's best-in-class app development support >>>>> A streamlined, 14 day to market process makes app distribution fast and >>>>> easy >>>>> Join now and get one step closer to millions of Verizon customers >>>>> http://p.sf.net/sfu/verizon-dev2dev >>>>> _______________________________________________ >>>>> Oorexx-devel mailing list >>>>> [email protected] >>>>> https://lists.sourceforge.net/lists/listinfo/oorexx-devel >>>>> >>>>> >>>>> >>>>> >>>> ------------------------------------------------------------------------------ >>>> This SF.Net email is sponsored by the Verizon Developer Community >>>> Take advantage of Verizon's best-in-class app development support >>>> A streamlined, 14 day to market process makes app distribution fast and >>>> easy >>>> Join now and get one step closer to millions of Verizon customers >>>> http://p.sf.net/sfu/verizon-dev2dev >>>> _______________________________________________ >>>> Oorexx-devel mailing list >>>> [email protected] >>>> https://lists.sourceforge.net/lists/listinfo/oorexx-devel >>>> >>>> >>>> >>> ------------------------------------------------------------------------------ >>> This SF.Net email is sponsored by the Verizon Developer Community >>> Take advantage of Verizon's best-in-class app development support >>> A streamlined, 14 day to market process makes app distribution fast and easy >>> Join now and get one step closer to millions of Verizon customers >>> http://p.sf.net/sfu/verizon-dev2dev >>> _______________________________________________ >>> Oorexx-devel mailing list >>> [email protected] >>> https://lists.sourceforge.net/lists/listinfo/oorexx-devel >>> >>> >>> >> >> ------------------------------------------------------------------------------ >> This SF.Net email is sponsored by the Verizon Developer Community >> Take advantage of Verizon's best-in-class app development support >> A streamlined, 14 day to market process makes app distribution fast and easy >> Join now and get one step closer to millions of Verizon customers >> http://p.sf.net/sfu/verizon-dev2dev >> _______________________________________________ >> Oorexx-devel mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/oorexx-devel >> >> > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > Oorexx-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/oorexx-devel > > ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ Oorexx-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/oorexx-devel
