GetAdapterModeCount() function is returning zero.

I have about 15 modes on D3DFMT_X8R8G8B8. Some help would be great.
"This method returns the number of display modes on this adapter or zero if Adapter is greater than or equal to the number of adapters on the system."
If someone can explain me what they mean by this that would be great also.
CODE
#include <iostream>
#include <fstream>
#include <d3d9.h>
#include <d3dx9.h>
#include <dxerr9.h>
void main()
{
//getting the IDirect3D9 interface
IDirect3D9* direct3dDevice;
direct3dDevice = Direct3DCreate9(D3D_SDK_VERSION);
//getting modes
D3DDISPLAYMODE mode;
// direct3dDevice->GetAdapterDisplayMode(D3DADAPTER_DEFAULT,&mode);
//opening file
std::ofstream myfile;
myfile.open ("example.txt");
UINT adapterCount = direct3dDevice->GetAdapterCount();
for (int i=0;i< adapterCount;++i)
{
int modeCnt = direct3dDevice->GetAdapterModeCount(i ,D3DFMT_X8B8G8R8);
for(int j=0; j< modeCnt; ++j)
{
direct3dDevice->EnumAdapterModes(i,D3DFMT_X8R8G8B8,j,&mode);
myfile<< "Width= " << mode.Width << " ";
myfile<< "Height= " << mode.Height << " ";
myfile<< "Format= " << mode.Format << " ";
myfile<< "Refresh= " << mode.RefreshRate << " " << std::endl;
}
}
myfile.close();
}