Getting string value from Text field: my 2.5 code stopped working

Matthew Jew mjew at icnc.com
Wed May 14 12:44:06 CDT 2008


Hello,

(This is another version 2.5.8 to 3.5.2 issue).

I have for years been using this code to retrieve my long text values  
from my TextFields:

I_FldBlob_Ptr pBlobField = dynamic_cast< I_FldBlob* > 
(aHTMLTemplateTable->valueText.get());
dataLength = pBlobField->get_DataSize();
aMutableData = [[NSMutableData alloc] initWithLength:dataLength];

Const_I_Value_Ptr myStringValue = aHTMLTemplateTable->valueText- 
 >get_Value();
unsigned long myStringLength = myStringValue->get_Length();
myStringValue->get_String( (unichar *) [aMutableData mutableBytes],  
dataLength );

returnValue = [NSString stringWithCharacters: (const unichar *)  
[aMutableData mutableBytes] length:myStringLength ];


Although this compiles, now my application gets a EXC_BAD_ACCESS  
error on the get_DataSize() call.

Is there a new way to do this?

- Matthew



More information about the Valentina mailing list