.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

TypedValue problem in 64 bit AutoCAD

3 REPLIES 3
Reply
Message 1 of 4
McSwiller
641 Views, 3 Replies

TypedValue problem in 64 bit AutoCAD

A line of code which works in 32 bit AutoCAD (2010) now fails under 64 bit AutoCAD (also 2010).

 

This line in particular:  args.Add(New TypedValue(RTLONG, oID))

[args is a ResultBuffer, oID is a Long value, and RTLONG is an Integer = 5010]

 

-I keep getting a truncation error saying it can't convert an Int64 to Int32. -Why should it matter what length oID is? It's an objec, why is it trying to convert it?t. -What do I need to change here to make this compatible for 64 bit AutoCAD?

3 REPLIES 3
Message 2 of 4

RLONG is for long in sense of C/C++ but not in C#. long in Microsoft C++ is equivalent of int (System.Int32) in C#.

That is why oID must be type of int.

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

Message 3 of 4

Is there an Int64 equivalent for a TypedValue then? (I can't convert the oID Int64 to Int32 without the truncation error - as you might've surmised, oID represents an ObjectId as a number - which is 64 bit Long, no?)

Message 4 of 4

Comment from file adscode.h:

// These next two codes are added for developer convenience and are
// not supported by entity access, dxf, xdata or xrecord routines.
// They are, however, supported by the resbuf utility functions
// (acutBuildList, acutNewRb and acedInvoke).
//
#define RTLONG_PTR 5030 // integer value with pointer precision
#define RTINT64    5031 // integer value with 64-bit precision

You can try those. Also you can try:

#define RTENAME   5006 /* Entity name */

 

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost