I found this googling around. I won't post link because I think the site where it originally was posted supports hacking activity, but here was the solution:
This error occurs shortly after launching the client and can be caused by a compatibility registry key for a library maplestory loads. It is fixed by removing the registry key.
The registry key is located at "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers", and contains a value with the name consisting of the path to your maplestory.exe, and the Data being something similar to "$~ IgnoreFreeLibrary<nmconew.dll>". The dll can vary. Deleting the value fixes the issue.