Help with IntPtr Please?

Help with IntPtr Please?

jshimkus
Advocate Advocate
1,015 Views
2 Replies
Message 1 of 3

Help with IntPtr Please?

jshimkus
Advocate
Advocate

I have these warnings that I cant figure out how to clear up...

'Public Sub New(oldId As Inter)' is obsolete: 'Use ObjectId(IntPtr)'

The highlghted lines of code are are all like this one....

oInputID =New ObjectId(CType(arInputArgs(0).Value, Integer))

I dont understand how to implement the correction

Could someone explain IntPtr and show me how to correct this line?

 

Thanks

0 Likes
1,016 Views
2 Replies
Replies (2)
Message 2 of 3

kerry_w_brown
Advisor
Advisor

Start here

http://msdn.microsoft.com/en-us/library/system.intptr(v=VS.90).aspx

http://social.msdn.microsoft.com/forums/en-US/csharpgeneral/thread/e7bb4152-30e3-4a00-93d5-036106042...

http://www.google.com.au/search?hl=en&rlz=1T4ADFA_enAU389AU389&q=c+intptr+tutorial&aq=0m&aqi=g-m1&aq...=

 

 


// Called Kerry or kdub in my other life.

Everything will work just as you expect it to, unless your expectations are incorrect. ~ kdub
Sometimes the question is more important than the answer. ~ kdub

NZST UTC+12 : class keyThumper<T> : Lazy<T>;      another  Swamper
0 Likes
Message 3 of 3

jshimkus
Advocate
Advocate

Thank you for the links, I see what it does, and I'd like to implement it as we are going to Win7 64 bit soon and this would save me from changing some code, but I still dont get how to change my code, all the examples dont pertain to autocad and ObjectIds so they are'nt helping me much. Can you gimme a push?

Here's a little more of the code...

  

Dim oInputID As ObjectId

Select Case (arInputArgs(0).TypeCode)

  Case CType(LispDataType.ObjectId, Short)

    oInputID = CType(arInputArgs(0).Value, Autodesk.AutoCAD.DatabaseServices.ObjectId)

  Case CType(LispDataType.Int32, Short)

'warning occurs on the following line

     oInputID = New ObjectId(CType(arInputArgs(0).Value, Integer))

 End Select  

 

 

0 Likes