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 :

Anonymous said...

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.

Esaias Pech said...

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!

Fernando Malard said...

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,

Esaias Pech said...

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!