Ok. One thing of note is that the button example only includes a a release configuration (i actually added the debug config thinking that the conversion wizard had screwed up and not converted it, i.e. /MDd, _DEBUG, optimisations off), if however you run a debug version of button, you get:
I'm still experiencing some problems with occasional crashes in release as well (I can at least read and write an image) . I'm going to take a stab in the dark and say the problem is probably this
this (note the comment at the very bottom). Since STL that is included with 2005 includes loads more security checks, iterator debugging etc, (i.e. all of that fscanf_s crap) the versions match enough to the old versions as to not cause problems linking, but do cause problems due to differences in internal data representations.
Therefore you get problems with containers when you pass them across the DLL bounds. The dll internally will assume the data it recieves is in the same layout as the template the dll saw when it was compiled. This however is not the case. As a result, you get problems with the data that the DLL recieves. When i first tried to integrate image magick into my project, i got warnings about the following classes (due to enabling warning level 4).
list<Magick::Coordinate>
list<Magick::Drawable>
list<Magick::VPath>
list<Magick::PathArcArgs>
list<Magick::PathCurvetoArgs>
list<Magick::PathQuadraticCurvetoArgs>
I noticed the button example doesn't generate these warnings, but with a bit of digging i found this (line:65, Include.h)
Code: Select all
# if defined(_VISUALC_)
# pragma warning( disable: 4273 ) /* Disable the stupid dll linkage warnings */
# pragma warning( disable: 4251 )
# endif
Which i'm guessing aren't that stupid
The best bet (imo) is to build a distribution with the following dll's
Code: Select all
<DllName>_2003.dll
<DllName>_2003_debug.dll
<DllName>_2005.dll
<DllName>_2005_debug.dll
<DllName>_2008.dll
<DllName>_2008_debug.dll
and corresponding libs. (assuming that you only care about /MD and /MDd - you could also go mental and do /MT and /MTd as well.. ). I have a feeling that's the probably cause of the crashes. Unfortunately i don't have a copy of 2003 around, but i'm guessing a debug version of button in 2003 probably works...
If you get a chance, can you see if you get a crash with a 2005/2008 debug build of button?