Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® Softimage® / XSI SDK / CString (const char *) bug
  RSS 2.0 ATOM  
2 pages: 1.2 first

CString (const char *) bug
Rate this thread
 
30200
 
Permlink of this thread  
avatar
  • luceric
  • Posted: 16 May 2009 10:07 AM

[quote=louisfeng;22891]Uhh, did you actually try to run this code? Did it actually print out “xsi”? Try this with 7.5 SDK:

Application app Application();
  
char hi[] "xsi";
  
CString msg(hi);
  
app.LogMessage(msg);

And tell me what it prints out.

actually it does indeed work for me, yes.

you using the default options for the compiler?  If you changed something like making the char type unsigned, you could get getting into trouble.  Also, do you have more than one version of Softimage on your computer—which could mean a risk of picking up the wrong SDK.  You can verify that by renaming temporarily the directory of the other Softimage installation. 

Also, if you are also using MFC, can you check with the debugger if it is calling XSI’s CString and not MFC’s class of the same name, you can test this by tracing in the debugger or by declaring XSI::CString instead of just CString. I’ll have to check my copy of the SDK is different, but it looks to be the same.

btw to convert that ‘name’ into the exact type the function required, the notation would be (const char*)name, but you’re not supposed to need it.



Replies: 0
avatar

OK, I checked the VS project setting, it inherits from the 7.5 SDK allcfg.vsprops, which defines the include dir to be $(XSISDK_ROOT)/include. And XSISDK_ROOT points to XSI 6.5’s SDK dir in my environment. Mystery solved!

Not sure how char * got implicitly converted to something else, the char * constructor didn’t exisit in 6.5 SDK, it should have failed to compile.

Thanks for your help.



Replies: 0
2 pages: 1.2 first