I'm attaching a copy of the code. I tried the AutoCAD update, but that didn't make a difference. I also tried both the 2010 and 2011 ObjectARX references; it doesn't make a difference.
I am compiling with Vis Studio 2008 on 32bit XP machine. My client is running W7, 64-bit 2011 AutoCAD Mechanical with update 1 (which includes update 1.1 for AutoCAD). I have access to a test machine that's running XP, AutoCAD 2011 (not mechanical), 32 bit, and this code works on that machine, compiled with ObjectARX 2010.
This code is copied from the video that shows how to convert VBA to VB.Net; it's in several places on the web. And it works on my test machine, but not on my client's machine.
The specific line of code that's creating the error is:
aDoc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.AcadDocument
If I comment out that line, recompile, netload my dll, and type TST, I get "This is a TST command". However, the BeginCommand and EndCommand code still don't display Begin and End Command.
If I leave that line in the code, recompile and netload my dll, and type TST, I get "unknown command".
So.. it's got something to do with referencing the acadDocument. But again, it works on my test machine - just not my client's.
Any ideas?
Thanks for your time.