DEFINE Class pm As session OlePublic && Compile as a COM (MyDLL.DLL) >PROCEDURE getListeTables () > oTables = CREATEOBJECT ("Collection") > > FOR i=1 TO ADIR (laList, "h:\temp\*.DBF") > oTables.Add(laList[i,1]) > ENDFOR > > RETURN oTables >ENDPROC >ENDDEFINE > >... > >DEFINE Class pm2 As session OlePublic && Compile as a COM (MyDLL2.DLL) >PROCEDURE getListeTables () > oTables = CREATEOBJECT ("MyDLL.PM") > oListTables = oTables.getListeTables () > oTables = NULL && This may cause the crash > RETURN oListTables >ENDPROC >ENDDEFINE > >... > >o = CREATEOBJECT("mydll2.pm2") >oTables = o.getListeTables() >? oTables.Count && Crash here > >FOR EACH lcTable IN oTables > ? (lcTable) >ENDFORI didn't mention this before because I didn't think it will have an impact, but now I think I know why it crash. The DLL that create the collection is killed before returning the collection to the parent. My guess is that it kill also the collection and when I'm trying to access it, VFP goes berzerk.