Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #9048

Re: Strange issue with Item API

Path csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From "Wolfgang Riedmann" <wriedmann@gmail.com>
Newsgroups comp.lang.clipper.visual-objects
Subject Re: Strange issue with Item API
Date Fri, 26 Feb 2016 11:39:47 +0100
Lines 73
Message-ID <djaobmFefbcU1@mid.individual.net> (permalink)
References <nap8ua$m2f$1@dont-email.me>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8
X-Trace individual.net IEwqvqeTT/aLNZL9aVJKGQvBbtpwNseiOmhQfQlUA6Wr4u54Y=
Cancel-Lock sha1:HlTAURAJmQPthj+Xotayh/b1OK4=
User-Agent XanaNews/1.18.1.6
Xref csiph.com comp.lang.clipper.visual-objects:9048

Show key headers only | View raw


Hi Martin,

do you lock the GC when calling the C code, or do you are protecting
your array in VO, maybe with one of the OldSpace... functions?

Personally, I don't knew that the item API was working in VO, maybe you
should try to rewrite the code to use the normal C interface.

Since Clipper was a 16 bit system, and VO is a 32 bit system, this
could be another source of problems - I don't know if the Item API was
adjusted when porting from VO 1.0 (16 Bit) to VO 2.x (32 Bit).

Wolfgang



Martin wrote:

> This is some code from our routine to read a string from a 2D array.
> And we are getting a very stange issue
> 
> 
> If the string contains a ; everything goes mad
> 
> The text on screen or report in C is blank, but hard reading the
> string letters gices text from a different array and element.
> 
> This is totally wierd, the code has been like this since we started
> in Windows and then that code was migrated from the Clipper ITEM API
> 
> Does anyone have any ideas why we are getting strange behavior when
> reading an array in C when there is a ;?
> 
> Thanks
> 
> Martin
> 
> 
> 
>        ITEM subarr;
>        ITEM elem;
>        LPSTR  str2;
>        UINT Type1, Type2;
> 
> 
>        // Get the sub array
>        subarr = ItemArrayGet(array, (UINT) row );
>        G3itemRegister(&subarr);
> 
>        // Get the element
>        elem = ItemArrayGet(&subarr, (UINT) element );
>        G3itemRegister(&elem);
> 
>        // Get the contents of element
>        Type1 = ItemType(&elem);
>        str2 = ItemGetC( &elem );
> 
>        //wcscpy( (wchar_t *) str, (wchar_t *) str2 );
>        strcpy(str, (char *)str2);
> 
>        // Release string
>        ItemFreeC( (LPBYTE) str2 );
> 
>        // Free sub array
>        G3itemRelease( &elem );
> 
>        // Free main array
>        G3itemRelease( &subarr );



-- 

Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Strange issue with Item API Martin <Martin@spam.spam> - 2016-02-26 10:24 +0000
  Re: Strange issue with Item API "Wolfgang Riedmann" <wriedmann@gmail.com> - 2016-02-26 11:39 +0100
    Re: Strange issue with Item API Martin <Martin@spam.spam> - 2016-02-29 10:13 +0000
      Re: Strange issue with Item API Martin <Martin@spam.spam> - 2016-03-21 10:35 +0000

csiph-web