First the backstory:
I am working to support the Phidget hardware (sensors and actuators) in Max on Windows 64bit. The company has always provided excellent support for their products in Max but the last year they could not give priority to provide a modern Max 6 suite of objects (maybe I was the only one harassing them). They were willing to share the code of the old objects.
To get the project going I started on MacOS 10.9 with Xcode 5.0.2 and the Max SDK 6.1.4. The dummy object in the SDK to compiles and I can debug the external just fine. So I went ahead and modified the Phidget object code to accommodate the new style initialization routine (it was still using setup). The new code compiles and pronto a fresh new external is delivered.
Now the problem:
When I instantiate the object in Max it does not work (the object shows but no inlets/outlets and the color is that of an unrecognized object - no error message in the Max window though). When I debug the code the debugger nicely lands in the main() function and a good (it looks good to me…) t_class can be seen at the end of main(). However, the new instance routine is never called and the strange thing is that the main() is called 3 times. After which the object box shows with the same behaviour as described above.
I have been trying to get past this for the last couple of days, carefully checking the code and even taking some time off to come at it with a fresh perspective. This post is another attempt along that line.
Please share any thoughts you might have.