visual c++ - VC++ system() function -


i using vc++ work. have open video file using vc++. have created batch file, writng command "start wmplayer path of videofile in wmv format"and coverted bat file exe format. used system() function open exe file. have completed work. last week purchased new laptop , installed microsoft visual studio 2010 same of old laptop. same code not running in new one. no errors coming. code been build. video not playing. if click batch file or exe file video running.

  1. i ceated bat file video. created new txt doc , saved .bat file. in wrote start wmplayer "path of video file" /fullscreen.
  2. i convert bat file .exe file using bat exe converter
  3. i wote program in vc++ (visual studio 2010 ide)

    #include #include #include

     int main()        {         system("path of .exe file");         getch();         return 0;        } 

i think code want:

int main() {   system("wmplayer \"path of video file\" /fullscreen");   return fgetc(stdin); } 

because 'command' has quotes in need backlash "escape them" otherwise treated start , end of string , go wrong.

i haven't compiled this, should work, if doesn't paste compiler output.

this basic , least elegant of solutions, start with.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -