Menu

DLL access finished (finally!)

Finally got DLL access sorted to my satisfaction. It's now slick enough that adding support for another class type (eg. classes for loading/saving data) will be a few minutes work at most. The code is not simple (5k lines including comments), but the interface is very neat so all the detail is well-hidden from the user, there's full checking to make it as bomb-proof as possible, and it'll be easy to reuse this on any future project. I'm quite proud of this code. :-)

Until last week this was using macro-functions, but I found it was dependent on the order of inclusion of header files for no apparent reason. Even looking at the preprocessor output, there didn't seem to be any reason. This became very nasty, so I investigated using templates as an alternative. It seems that GCC does now do templates, and VC++ 5 is quite happy as well, so that's all fine.

The last few days have therefore been spent investigating templates and reworking the code to use them where appropriate (the linked-list utility has also changed to be a template class). It's worked out really nicely, and it seems a lovely, elegant way of doing things. I only wish I'd known about it earlier!

With DLL access sorted, it's time to get onto setting stuff up for actual hardware access for programming. Time to dig out that old ProPIC2 programmer and see if the damn thing works, I guess. :-/

I may also improve the parallel port access class if the mood takes me; alternatively I may just leave it for the moment and fix it at the end. This class is hardcoded to work on my machine's settings, so it'll be useless to anyone else. I need to fix it at some point, but I probably won't do it until a bit later because it's good enough for the moment.

I also need to rework the programming data class, because that's very inefficient in how it allocates memory. But again, it's working now so I don't plan on messing with it just yet.

Posted by Graham Bartlett 2003-03-07

Log in to post a comment.