I program using Visual C++ 2008. MFC Application.
I was creating a program to open a Media (.avi) file. The default association of avi files is the Windows Media Player. Now in the program I want to load a button that when clicked will open the specified avi file using the VLC Media Player installed.

I would highly appreciate if an example code is provided.

For Instance :-
Video File Location : D:\My Videos\ABC XYZ.avi
VLC File Location : E:\Program Files\VLC Media Player\vlc.exe

Please provide a OnButtonClicked Function for the above Instances.

Thanks in advance.

WHy not try putting the 2 files involved .i.e VLC.exe and the video itself in the same directory?

(I don't want to do that). If suppose i do it. how do I open the file using the VLC Media Player when the default association is Windows Media Player. Thats the problem.
Assume I shift the video to the same directory as vlc.exe

E:\Program Files\VLC Media Player\ABC XYZ.avi
and
E:\Program Files\VLC Media Player\vlc.exe

I still cant get to open the video using VLC.

If I just run the video it opens normally with Windows Media Player. The basic thing I want to know is how to run it using VLC Media Player)

(oh... and yes, the program that I'll make is on (say) Desktop, i.e., not in the same directories above)

I'll Highly Appreciate if you please provide a sample code.
Thanks

Edited 6 Years Ago by Kunal Aggarwal: n/a

Dear sir/madam

I want a media player in visual c++.In which i can run any files.I have downloaded a code a aviplayer from ur site and tried to play a video but it is not working. am getting a error as following:

"The specified file cannot be played on the specified MCI device.The file may be corrupt,not in the correct format,or no fil".

this is the error am getting can u plz help me.

my requirement of media player is i want a two screens as output one should be smaller and contain some of the basic buttons.the other should be with full screen and no buttons should be available.if am changing the buttons in small player the things should be changed in both of them.

and one should be connected to one port and other should be able to connect to other port can u plz me by sending the code.

Regards
Srilekha

This article has been dead for over six months. Start a new discussion instead.