I would suggest getting rid of any intermediary files like *.dcu and doing a "Build All". Also make sure that you have exceptions turned *on* when debugging your code as it sounds like an AV may be happening in that function and it then throws you out. The only other possiblity that comes to mind would relate to multi-threading. Are you using anything in another thread that may be causing a problem?