Mounting a disk with the DiskArbitration framework
A few years later, and not being a C expert; 
As far as I know (using Pascal myself), your application needs to wait for the callback to happen. By the looks of it though (again: not an expert) your application may already closed/finished before the callback actually happened.