I need to use this (unmanaged) C++ library. One of the methods has a wchar_t* as a parameter. Tried using it in C#, but all my attempts resulted in an error code 'invalid argument'.
I wrote a managed C++ wrapper for it - same problem. Now I compared the values of arguments from my C++ wrapper and native C++ example that came with the library. The only significant difference I see is that NUL in my managed C++ is "0 L''" (Visual Studio watch) and NUL in unmanaged example is simply "0". They both have the same value... 0.
Can this really be the issue? (I tried manually setting that character to '0' but got the same results) If yes, how do I solve it?
EDIT: Image: http://img6.imageshack.us/img6/5977/comparisonofvalues.png Ok, on the left side is my code (managed C++), on the right side is the example (unmanaged C++). As it is, right one is working, left one isn't (the function rejects the arguments). I think the issue is in the 17th character - NUL. Any further thoughts?