Dynamically changing Textbox’s AutoComplete List causes AccessViolationException, any advice?

It’s Possible!!! About 3 hours searching and according to information in this post I found solution. You have to delete almost all elements from AutoCompleteCustomSource (or ComboBox.Items), Then AddRange() and finaly remove 0-index item: private void comboBox1_PreviewKeyDown(…) { while (comboBox1.Items.Count > 1) { comboBox1.Items.RemoveAt(comboBox1.Items.Count – 1); } comboBox1.Items.AddRange(<your_new_items>); comboBox1.Items.RemoveAt(0); } But this method too slow … Read more

Address canonical form and pointer arithmetic

The canonical address rules mean there is a giant hole in the 64-bit virtual address space. 2^47-1 is not contiguous with the next valid address above it, so a single mmap won’t include any of the unusable range of 64-bit addresses. +———-+ | 2^64-1 | 0xffffffffffffffff | … | | 2^64-2^47| 0xffff800000000000 +———-+ | | … Read more

Getting Segmentation Fault

All your examples are causing undefined behaviour, which might lead to a crash (or it might not appear to do any harm at all). You’re not allowed to change a string literal. (see e.g. here) You forgot to allocate storage for the terminating nul byte, do malloc(strlen(str) + 1); You’re calling free() on a pointer … Read more

Gracefully handling corrupted state exceptions

Instead of using <legacyCorruptedStateExceptionsPolicy> it would be better to use [HandleProcessCorruptedStateExceptions] (and [SecurityCritical]) as stated here: https://msdn.microsoft.com/en-us/magazine/dd419661.aspx Following that, your Main method should look something like this: [HandleProcessCorruptedStateExceptions, SecurityCritical] static void Main(string[] args) { try { … } catch (Exception ex) { // Log the CSE. } } But be aware that this doesn’t catch … Read more