Fixing those SxS syntax errors in encoding
Well it seems as if more people are stumbling over problems when they use buggy libraries and package via MMM.
I'm, pretty sure I've found the culprit: bad attempts at encoding illegal XML characters combined with very poor quality libraries you are trying to use.
I won't mention names, you know who they are if you've had these troubles. It seems that they've been creating libraries where there are typelib comment strings that are improperly terminated. It looks like they think you can just slop your C string buffer in there and everyone will stop at the first NUL and ignore your buffer garbage. Clearly somebody is using poor build tools that don't understand a BSTR or something.
If they make a blatent error like this can you trust the rest of their code to work right? I wouldn't. Be afraid.
I should talk, clearly MMM wasn't up to the task of protecting you from code that breaks the rules. Wait a minute... that's not MMM's job!
Give the new version a spin, I hope it addresses the matter to your satisfaction rather than creating new headaches.
Download (still) beta version 0.9 here.
- Posted at Thursday, April 14, 2011 12:19 PM
- In General Category | Permalink
- Name:
- E-Mail Address (optional):
- URL (nofollow, optional):
- Remember personal info
- Comments (text only):

I've just found this and I love it! Thank you so much for providing us with such an amazing tool, I really appreciate it.
Posted by Andy on Tuesday, April 26, 2011 10:54 AM
Thanks Andy, I hope it works for you with few troubles.
Posted by BVOCS on Tuesday, April 26, 2011 02:45 PM
The SetDPIAware section of the manifest works fine in Vista but it does not work in Windows 7 (I have tried MMM8 and MMM9 and it does not work in either). I've found that I can fix this problem by manually editing the manifest file. I've just attempted to post the solution here in this comment but I get a warning that the html tags in my example will be removed automatically. How can I post the solution here without it being messed up by the removal of the tags?
Mike
Posted by Mike Williams on Tuesday, May 17, 2011 01:00 AM
I'm not sure you can enter tags, even as entity codes: < >
Maybe try putting in your fix here substituting { and } instead?
Posted by BVOCS on Wednesday, May 18, 2011 08:37 PM
The SetDPIAware section works in Vista but not in Win7 (at least on the machines I've tested it on). To make it work for both Vista and Win7 I did the following:
1. Replace the line:
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
. . . with the line:
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" >
2. Replace the section:
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
<dpiAware>true</dpiAware>
</windowsSettings>
</application>
. . . with the section:
<asmv3:application>
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
<dpiAware>true</dpiAware>
</asmv3:windowsSettings>
</asmv3:application>
Mike
Posted by Mike Williams on Sunday, May 22, 2011 07:08 AM
Thanks Mike. Are you suggesting this works both on Vista and Windows 7? If so, does the resulting program still work (ignoring the setting) on WinXP? I'll take a look at this, the namespace versioning has been a pain in general.
Posted by BVOCS on Wednesday, June 1, 2011 08:56 PM
Yes, thank you SO SO much for this. I was looking for a way to do something like this using LoadLibrary in Form_Initialize and was having zero luck. I stumbled across something about this on Planet Source Code and first thought it was a hoax, but to my astonishment, there was something like this. If I could only donate money, I totally would because this has saved me hours, if not days.
Posted by Jim on Tuesday, June 21, 2011 01:10 AM
Thanks for the kind words, Jim. As you'll see in my next blog entry here my MMM involvement is sunsetting though. The good news is the MMM source code is now fully available in the most open form I could manage it. Seven years of struggle on that one!
Posted by BVOCS on Sunday, July 24, 2011 09:21 AM
In response to BVOCS statement about whether my suggested fix for the SetDPIAware problem in MMM8 and MMM9 generated manifests would work on both Vista and Windows 7, the answer is Yes. It works on both of those systems. The resulting program also works fine on Win XP SP3 (although XP ignores the setting of course because it does not have the Vista and Win7 dpi virtualization).
There was once a bug in XP SP2 which caused a manifest with two schema properties in a single tag to crash the system. That bug definitely seems to have been fixed in XP SP3 though, according to my tests on a couple of XP SP3 machines this afternoon. There may be another way to get the MMM DPIAWare manifest to work on Win7 without using two schema properties in a single tag, but to be quite honest these manifest things make my head spin and I haven't got the bottle to look into that at the moment! My suggested fix does work fine though, and so I think I'll personally stick with that for the time being.
Mike
Posted by Mike Williams on Saturday, August 13, 2011 08:44 AM