Wouter,
Nick is probably right, you have a DLL that's trying to put up a VFP error dialog and it can't since it's a DLL. You must take extraordinary care in a DLL and do things like check FILE() before you try to open a file. You also need to put an error handler in place that will log the error to a .txt file(s) so that you can easily go in and post-mortem the crash.
>Why do I get this error:
>
>Error:2031
>Error message: User-interface operation not allowed at this time.
>Line of code with error: 600
>Line number of error: 9
>Program with error: DOS.SELECTIONEXISTS
>
>In this line:
>
>USE (THIS.SelDir + '\S_Seldef') IN 0 AGAIN ALIAS SelectionExists_Tmp
>
>Does it look I want any user interface here? What do I do wrong?
>
>The error above was catched with an error handler, so the line of code above does not want to display an error.....