ObjectARX & Dummies

Course Index

*Course support: Click here!
*Course and User samples: Download here!

Tuesday, March 25, 2008

Blog Classes content update

Hello,

I have updated and fixed some classes sample code that are not UNICODE aware that will not compile inside VS2005 (ObjectARX 2007, 2008 and 2009).

Basically, I have changed:

- Add _T() macro to all strings;
- Changed strcpy() to _tcscpy() which is UNICODE aware;
- Changed char* to TCHAR* or to ACHAR* pointers;

Important: ACHAR is a typedef present inside "AdAChar.h" ObjectARX header. If you are trying to compile for non-UNICODE ObjectARX versions replace ACHAR* by TCHAR* (or char*) and you should get out of compilation errors.

Cheers!

4 Comments:

  • Thanks Dude. It was realy a appreciable help. I was exactly searching for what you have described. If i get any problems in future, if you don't mind, i would disturb you.


    Thank You so......... Much.

    Bye.
    Take Care.

    By Anonymous Anonymous, at 6:07 AM  

  • Is there a way to disable Unicode in ObjectArx 2010 (VS2008)??
    We have some code that was written without taking into account Unicode (using functions like atol, atof, etc) and don't want to be changing all of those functions to port it to arx (if we have to, we'll do it, we need to).
    Thanks in advance!

    By Blogger Estudiante, at 5:52 PM  

  • Hello Estudiante,

    No, 2010 is UNICODE only. You need to migrate your code but it can be smart to compile in both scenarios.

    You can use the smart methods to turn your code compatible with both UNICODE and non UNICODE compilations.

    The target compiler will expand the method accordingly to ANSI or WIDE.

    Take a look here:

    http://www.i18nguy.com/unicode/c-unicode.html

    Hope this help.
    Regards,

    By Blogger Fernando Malard, at 12:11 AM  

  • Obrigado Fernando!
    After posting the comment on your blog I read some stuff on Through the Interface and realized that it's one of the advantages of 2010.
    Thank you for the link,

    Saludos!

    By Blogger Estudiante, at 12:28 AM  

Post a Comment

<< Home