If you are developing an application for use on both Civil 3D 64 bit and 32 bit environment you may come across an issue with ObjectId object. If you compile it on a 32 bit machine the code won’t work on a 64 bit machine. This is due to the fact that the ObjectId object will have the wrong IntPtr.
I recently came across an easy fix for this using p/Invoke. Now I’m not an expert on using p/Invoke, but the way I understand it is that you can call an object without knowing what that object is. In this case we know what it is, we are just able to get the correct IntPtr type at run time instead of when we create the code. Below is the code (c#) Jeff Mishler posted in the discussion group.
If you want more information on how p/Invoke works I’d suggest doing a Google search on it.