{ cdbfapiPlus* dbf = new cdbfapiPlus(); if (!dbf) return; if (dbf->openDBFfile("c:\\tmp\\example.dbf")) { // your code dbf->closeDBFFile(); } delete(dbf); }