On Fri, May 3, 2013 at 12:39 AM, Bob Delaney <[email protected]> wrote:
> In my plugin I have for inputString as a REALstring:
>
> REALstringData          *rsData;
>
> REALGetStringData(inputString, REALGetStringEncoding(inputString), rsData);
>
> For that last statement I get the warning: 'rsData' is used uninitialized in 
> this function
>
> How do I initialize 'rsData'?
>
> And I would appreciate it if someone would give me a good reference on these 
> matters.
>
> Bob

The idea behind REALGetStringData is that you want to get the string's
contents in an encoding that your code understands.

To give a real world example: we have a plugin internally that needs
to draw a string given to us by the user. Previously we would have had
to do an explicit encoding conversion, gotten the string's contents,
and then gone on with the work we actually cared about. The 'modern'
approach looks like this:
  REALstringData title;
  if (REALGetStringData( data->title, kTextEncodingUTF16LE, &title )) {
    ::DrawTextW( dc, (LPCWSTR)title.data, ... );
    REALDisposeStringData( &title );
  }

The sample projects that ship with the SDK may not have been updated,
so file a Feedback case if you see places where it needs changing.

--
Joe Ranieri
Mac Frameworks & Compiler
Real Software, Inc.

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to