C++/CLI Properties

178 words.

Properties in C++/CLI are great and all, but, um, what if I want to put my class implementation in a different file from the class definition? You know, like, oh, every C++ program ever made in the entire history of the world. Microsoft even encourages the separation of definition from implementation by creating a .cpp and a .h file when you make the new managed class. I guess Microsoft figured we would just put the whole class implementation into the .h file while leaving the .cpp file empty. Yeah, that makes perfect sense… if you’re on crack.

This rant came about because I was trying to implement a setter property (in the class.h file) that referenced some functions in another class. This resulted in all kinds of errors because at that point in the compilation, the setter did not understand anything about the implementation of the other class. You’d think that would be easy to fix by moving the property implementation into the class.cpp file where it belongs, but you’d be wrong because you can’t do that. Blah.

Related

This page is a static archival copy of what was originally a WordPress post. It was converted from HTML to Markdown format before being built by Hugo. There may be formatting problems that I haven't addressed yet. There may be problems with missing or mangled images that I haven't fixed yet. There may have been comments on the original post, which I have archived, but I haven't quite worked out how to show them on the new site.

Sorry, new comments are disabled on older posts. This helps reduce spam. Active commenting almost always occurs within a day or two of new posts.