String to char* problem (varargs related?)
-
I've got an unmanaged varargs function:
print(char*, ...);
And I've got an exception:catch (System::Exception *ex)
And I try to print it:print("%s", ex->Message);
And I get 5 weird symbol characters in the output. What's going on? Am I doing something wrong here? I check Message in managed code and it's fine. Print works fine too, for everything else. -
I've got an unmanaged varargs function:
print(char*, ...);
And I've got an exception:catch (System::Exception *ex)
And I try to print it:print("%s", ex->Message);
And I get 5 weird symbol characters in the output. What's going on? Am I doing something wrong here? I check Message in managed code and it's fine. Print works fine too, for everything else.Just a guess, maybe it's because ex->Message is in Unicode? And your print function only works on ANSI NULL terminated strings? Regards Senthil _____________________________ My Blog | My Articles | WinMacro
-
I've got an unmanaged varargs function:
print(char*, ...);
And I've got an exception:catch (System::Exception *ex)
And I try to print it:print("%s", ex->Message);
And I get 5 weird symbol characters in the output. What's going on? Am I doing something wrong here? I check Message in managed code and it's fine. Print works fine too, for everything else.