I have a problem in my Borland C++ project.
I need to use my own COM object written in C# (this COM allows me to directly print PDF files) in my another project in C++, but as soon as I call some COM functions which require a string parameter (output file path) my COM throws an exception: Illegal characters in path. So I used for (int i = 0; i < mDocumentFileName.Length; i++) and I found out that at the end of the string there is a \0 character. As far as I know a typical string ends with \0 so the Lenght param should return the number of character before the \0 is reached so if the mDocumentFileName = "out.pdf" it should ends with 'f' not with '\0'. In Borland C++, I use AnsiToOLESTR to convert ansi strings to wchar_t strings.
What's wrong? Or how to solve this?