title: What is the "Cannot set allocations" error, who emits it and what can I do about it?
body: <p>We've been plagued for several years by occasional reports from customers about a non-descript error message "Cannot set allocations" that appears on startup of our app. We have never been able to reproduce the problem in our own test environments so far. I have now run out of ideas for attempting to track this down. Here's a collection of observations that have accumulated over time:</p>
  
  <ul>
  <li>Error message text reads "Cannot set allocations" (note absence of punctuation).</li>
  <li>The window title simply reads "Error" (or the localized equivalent).</li>
  <li>The "Cannot set allocations" text is always in English regardless of OS locale.</li>
  <li><p>I have so far not been able to locate the DLL or EXE containing the message text.</p></li>
  <li><p>Google is chock full of <a href="http://www.google.com/search?q=%22cannot+set+allocations%22" rel="nofollow noreferrer">reports of this error</a> for a variety of different products - but no solutions.</p></li>
  <li><p>The only unifying aspect between the affected products I could make out so far was that they all appear to come in the form of DLLs that load into third-party processes (such as addins for Visual Studio or Windows Explorer shell extensions).</p></li>
  <li><p>Our app is actually a shareware COM-addin for MS Outlook, written in Delphi (i.e. native code - no .NET).</p></li>
  <li><p>The prime suspect in our case is the third-party licensing wrapper that we're using which decrypts and uncompresses our DLL into memory on the fly. Obviously I couldn't simply give an unprotected version of our app to the affected customers to verify this suspicion. Maybe the other vendors that this has been reported against are using similar products.</p></li>
  <li><p>Debug versions of the protection wrapper supplied to us by the licensing vendor yielded no results: The log files looked exactly the same as from sessions where the error did not occur. Apparently the "inner" DLL gets decrypted and uncompressed all right but for some reason still fails to get loaded by the host process.</p></li>
  <li><p>By creating an unprotected "loader" DLL we have been able to pinpoint the occurrence of the error somewhere behind the <code>LoadLibrary</code> call that is supposed to load our DLL into memory.</p></li>
  <li><p>Extensive logging and global exception hooks in our own code (both the unprotected loader and the protected "core"-DLL) yielded no results at all. The error is obviously raised somewhere else.</p></li>
  <li><p>The problem described in <a href="https://stackoverflow.com/questions/546051">this earlier question of mine</a> was very probably prompted by the same issue. This was before we created the unprotected loader stub.</p></li>
  <li><p>The error only occurs at about 1-2% of our customers - whereas typically all installations at any affected customer's site are affected the same.</p></li>
  <li>Sometimes the error goes away after we release a new version but often it will come back again after a couple of weeks or months.</li>
  <li>Once the error has started to occur on a machine it does so consistently.</li>
  <li><p>The error never occurs while connected to the affected machine via remote access (e.g. VNC, RDP, TeamViewer, etc.) and none of the affected customers are within travel distance from us so all we have to go by is log files and "eye-witness reports".</p></li>
  <li><p>One customer reported that the error message dialog apparently was non-modal, i.e. he was able to simply move the dialog box to the side and continue working with the application (minus the functionality that our DLL would have provided). Not sure whether this is universally true in all other occurrences, too.</p></li>
  <li><p>In some cases customers have been able to permanently rid themselves of the error by disabling or uninstalling other addins from other vendors that were sharing the host application with our own product.</p></li>
  <li><p>The error has so far been observed on Windows XP, Vista and 7.</p></li>
  <li><p>During the last few weeks we had a surge of reports from Outlook 2003 / Windows 7 users. Could the situation have been made worse by a recent Windows/Office-update?</p></li>
  </ul>
  
  <p>Does anyone have any experience with this error at all?</p>
  
  <p>Or any more ideas for investigating this?</p>