can any one give c++ program to eject cd from cd-rom,
i am getting error in this program please solve this

// use mciSendString() to open and close the CD-ROM door
// you have to link with the winmm.lib file, or
// in the case of Dev-C++ link with libwinmm.a via
// Project>>Project Options>>Parameters>>Add Lib>>libwinmm.a
// a Dev-C++ tested console application by  vegaseat  18dec2004

#include <iostream>  
#include <windows.h>   // Sleep() 
#include <mmsystem.h>  // mciSendString()

using namespace std;   // std::cout, std::cin

int main()  
  mciSendString("open CDAudio", NULL, 0, NULL);
  cout << "Opening CD-ROM door ..." << endl;  
  mciSendString("set CDAudio door open", NULL, 0, NULL);  

  cout << "Closing the CD-ROM door in 5 seconds ..." << endl;  
  mciSendString("set CDAudio door closed", NULL, 0, NULL);  

  mciSendString("close CDAudio", NULL, 0, NULL);

  cin.get();  // wait  
  return 0;  

add #pragma comment(lib,"Winmm.lib") somewhere in your *.cpp program, preferably before main()

BTW the program works ok on my computer -- 64-bit Windows 7.