Skip to main content
Known Participant
November 16, 2007
Question

[IDCS2 Win]Problem Writing PMString to a text file using IPMStream!

  • November 16, 2007
  • 2 replies
  • 281 views
Hi,

I want to write a PMString value into a text file.sometimes the string is written in the txt file & sometime it is not written in the file.Instead of writing the String i get some square boxes written in the file.Some times some special symbols like @,<,# etc gets written along with the boxes!I dont know why this is happening.

This is the code i have written:
PMString swatchName="";//String that i want to write in txt file
IDFile DetailsFile;//The txt file where i want to write
IPMStream * txtFileOutStream = StreamUtil::CreateFileStreamWriteLazy(DetailsFile,kOpenOut);
txtFileOutStream->Open();
swatchName.ReadWrite(txtFileOutStream);
txtFileOutStream->Close();

Plz tell where im going wrong.Help needed very urgent.

Thanks in advance
This topic has been closed for replies.

2 replies

Known Participant
November 16, 2007
Thanks a Lot!It Works
Inspiring
November 16, 2007
Hi,

Try the follwing as an alternative to
swatchName.ReadWrite(txtFileOutStream);

int32 len = swatchName.CharCount();
txtFileOutStream->XferByte( ( uchar * )swatchName.GrabCString(), len );

Regards,

Mike.