That won't work as such a call (which requires the directx .dll to be at least installed) will cause the entire app to fail if directx is not installed.
This is pbly the best test you can do at present:
Strict
UseD3D7
If PrimaryDevice Notify "DX7 Primary Device Is Initialized"