WMP and SetMute
WMPTalk.com Forum Index WMPTalk.com
Discuss Windows Media Player
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web wmptalk.com
WMP and SetMute

 
Post new topic   Reply to topic    WMPTalk.com Forum Index -> SDK
Author Message
mark
Guest





Posted: Thu Nov 24, 2005 9:30 pm    Post subject: WMP and SetMute Reply with quote

I've tried to use SetMute function from WMP activex control in a dialog based
window but it don't work. All others commands are in GetControls() like here:

CWMPPlayer4 m_ctrlPlayer;
m_ctrlPlayer.GetControls().play();

SetMute is in CWMPSettings.

if I do this:

CWMPSettings settings;
settings.SetMute(TRUE);
or
settings.SetMute(FALSE);

I haven't any result.


I ask: how is possible to use SetMute function?

Back to top
Neil Smith [MVP Digital M
Guest





Posted: Fri Nov 25, 2005 1:30 pm    Post subject: Re: WMP and SetMute Reply with quote

On Thu, 24 Nov 2005 12:54:01 -0800, "mark"
<mark@discussions.microsoft.com> wrote:

Quote:
I've tried to use SetMute function from WMP activex control in a dialog based
window but it don't work. All others commands are in GetControls() like here:

I don't know a *method* to set that. Are you sure you shouldn't just
set the property directly, as the SDK states :

player.settings.mute=[true | false]

Maybe you're getting confused with the SetMode method ?

HTH
Cheers - Neil
Back to top
Neil Smith [MVP Digital M
Guest





Posted: Fri Nov 25, 2005 5:30 pm    Post subject: Re: WMP and SetMute Reply with quote

On Fri, 25 Nov 2005 06:26:03 -0800, "mark"
<mark@discussions.microsoft.com> wrote:

Quote:


"Neil Smith [MVP Digital Media]" wrote:


I don't know a *method* to set that. Are you sure you shouldn't just
set the property directly, as the SDK states :

player.settings.mute=[true | false]

Maybe you're getting confused with the SetMode method ?

HTH
Cheers - Neil



I'm talking about c++ programming. I can't do what you say. I need to set as
mute the WMP volume. As I have described above I can't to use the SetMute
function inside CWMPSettings class becouse I see in the VC6 debug window the
message "Warning: attempt to call Invoke with NULL m_lpDispatch!".

OK, sorry. I don't know what true and false enumerate to in C++ :
However the SDK states in the property translation guide :

================================================
"In JScript, the following syntax block is for a read-only property
that contains a String value representing the duration of the current
media item:

player.currentMedia.durationString

The C++ equivalent is an accessor method that returns an HRESULT and
places the durationString value at the location specified by the
pbstrDuration pointer:

HRESULT get_durationString(BSTR* pbstrDuration);

================================================

So I'm guessing it should read as
IWMPSettings put_mute(BOOLEAN);
instead ?

HTH
Cheers - Neil

Back to top
mark
Guest





Posted: Fri Nov 25, 2005 5:30 pm    Post subject: Re: WMP and SetMute Reply with quote

Quote:

OK, sorry. I don't know what true and false enumerate to in C++ :
However the SDK states in the property translation guide :

================================================
"In JScript, the following syntax block is for a read-only property
that contains a String value representing the duration of the current
media item:

player.currentMedia.durationString

The C++ equivalent is an accessor method that returns an HRESULT and
places the durationString value at the location specified by the
pbstrDuration pointer:

HRESULT get_durationString(BSTR* pbstrDuration);

================================================

So I'm guessing it should read as
IWMPSettings put_mute(BOOLEAN);
instead ?

HTH
Cheers - Neil





Thank you Neil but in this way you can't help me. I need somebody that knows
c++ programming
Back to top
mark
Guest





Posted: Fri Nov 25, 2005 5:30 pm    Post subject: Re: WMP and SetMute Reply with quote

"Neil Smith [MVP Digital Media]" wrote:


Quote:
I don't know a *method* to set that. Are you sure you shouldn't just
set the property directly, as the SDK states :

player.settings.mute=[true | false]

Maybe you're getting confused with the SetMode method ?

HTH
Cheers - Neil



I'm talking about c++ programming. I can't do what you say. I need to set as
mute the WMP volume. As I have described above I can't to use the SetMute
function inside CWMPSettings class becouse I see in the VC6 debug window the
message "Warning: attempt to call Invoke with NULL m_lpDispatch!".
Back to top
The March Hare [MVP]
Guest





Posted: Sat Nov 26, 2005 5:30 pm    Post subject: Re: WMP and SetMute Reply with quote

On Thu, 24 Nov 2005 12:54:01 -0800, mark wrote:

Quote:
CWMPPlayer4 m_ctrlPlayer;
m_ctrlPlayer.GetControls().play();

SetMute is in CWMPSettings.

if I do this:

CWMPSettings settings;
settings.SetMute(TRUE);
or
settings.SetMute(FALSE);

I haven't any result.


Don't you need to do something like this?

CWMPSettings settings = m_ctrlPlayer.GetSettings();
settings.SetMute(TRUE);

Another alternative is to use the regular COM interfaces:

#include "wmpsettings.h"

CComQIPtr<IDispatch> dispatch = m_ctrlPlayer.GetSettings().m_lpDispatch;
if (!dispatch)
return E_NOINTERFACE;
CComQIPtr<IWMPSettings2> settings(dispatch);
if (!settings)
return E_NOINTERFACE;

settings->put_mute(TRUE);


--
Please read this before replying:
1. Dshow & posting help: http://tmhare.mvps.org/help.htm
2. Trim & respond inline (please don't top post or snip everything)
3. Benefit others: follow up if you are helped or you found a solution
Back to top
 
Post new topic   Reply to topic    WMPTalk.com Forum Index -> SDK All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Microsoft Office Forum New Topics
Powered by phpBB