THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 30/06/2004 at 16:12, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 8.5
Platform: Windows ;
Language(s) : C++ ;
---------
I am trying to write a text converting routine that would take Cinema 4D string and convert them to standard C++ strings (chars).
I have gotten some code from this forum that works well as long as I put it in the main execute section of the plugin. When I try to make a function/class/whatever its called out of it, it fails. Here is the code:
char ConvertString (String origString)
{
LONG len = origString.GetCStringLen();
CHAR* sqlStr = bNew CHAR[len+1];
return origString.GetCString(sqlStr,len+1);
}
I call the function like
exportfile << ConvertString(object->GetName()) < "\n". When I use this to write out to a text file, it doesn't work. If I take the exact same code and place it right before Im going to write out the text file, it works, for example:
LONG len = object->GetName().GetCStringLen();
CHAR* sqlStr = bNew CHAR[len+1];
object->GetName().GetCString(sqlStr, len+1);
exportfile << sqlStr < "\n";
Can anyone help a newbie?
Matt