Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.clipper.visual-objects > #9058
| From | Martin <Martin@spam.spam> |
|---|---|
| Newsgroups | comp.lang.clipper.visual-objects |
| Subject | Re: Strange issue with Item API |
| Date | 2016-02-29 10:13 +0000 |
| Organization | A noiseless patient Spider |
| Message-ID | <nb15eb$dja$1@dont-email.me> (permalink) |
| References | <nap8ua$m2f$1@dont-email.me> <djaobmFefbcU1@mid.individual.net> |
We have been using the Item API for about 10 years with VO. And it is only semi colons which mess up. Found it was getting the data from the previous read string from VO array call. That is our only advance since posting. On 26/02/2016 10:39, Wolfgang Riedmann wrote: > 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
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