Click here to Skip to main content
15,888,454 members
Please Sign up or sign in to vote.
5.00/5 (2 votes)
See more:
Today I was reading an online article, and, I was wondering whether you would have some samples of calling Windows Media Player as an object, as I cannot quite find a COM object named IWMPPlaylist, when I try to add a reference under COM components.

Also can anyone remind me of the disadvantages of COM Objects and why I should avoid them?

Admittedly I did find an online article at ,[^], however, I am not quite sure I am getting all the instructions required to come up with a working Media Player.

Is this available as an object that I can easily use as WMP w = new WMP(), and, then review the documentation on MSDN?
Posted

What I know COM objects have huge requirements on memory..
 
Share this answer
 
Comments
_Amy 29-Jul-14 3:10am    
Reason for 3 : Needs little more explanation.
In-process servers provide the speed and size advantage of an object handler with the editing capability of a local server. So why would you ever choose to implement your OLE application as a local server rather than an in-process server? There are several reasons:
Security. Only a local server has its address space isolated from that of the client. An in-process server shares the address space and process context of the client and can therefore be less robust in the face of faults or malicious programming.
Granularity. A local server can host multiple instances of its object across many different clients, sharing server state between objects in multiple clients in ways that would be difficult or impossible if implemented as an in-process server, which is simply a DLL loaded into each client.
Compatibility. If you choose to implement an in-process server, you relinquish compatibility with OLE 1, which does not support such servers. This will not be a consideration for many developers, but if it is, then it is of critical concern.
Inability to support links. An in-process server cannot serve as a link source. Since a DLL cannot run by itself, it cannot create a file object to be linked to.


To play a simple playlist using Media Player, you would like to use:
C#
Process.Start("wmplayer.exe", "Playlist Path");

Or
MSDN : Embedding the Windows Media Player Control in a C# Solution[^]

--Amy
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900