Hm another one, i corrected the errors in above example and it still crashes at the rb_define_class call.... No idea what it could be... By the way this is an Application which uses the engine DLL which embeds RUBY and exports this class... And it's running under Win2000... We tried all the defines etc... but nothing works it still crashes at rb_define_class. Are there any special steps required ( except NtInitialize) to embed ruby properly and allow to export the classes ? Thanks