|
"2" is not a number but a C-Style null terminated string (actually, an array of two chars : { '2', '\0' } .
idineen wrote: how can i stop this number from being converted to its ascii value of 50 when passing it through the parameter.
can you show us a piece of the code by which you call the function, and how the function uses this parameter too ??
i'm quite sure you don't use it properly.
|
|
|
|
|
the code below is used to put a snmp object id into a pdu packet along with 3 parameters. the third parameter is used by the program to identify that the paramter is interrupted as a integer. the 4th parameter "test" is the number that i want to pass, this parameter is of type "(u_char *)" and the last is the length of the string.
snmp_pdu_add_variable(pdu, oid, oid_length, ASN_INTEGER , test, strlen(test));//
thanks
ian
|
|
|
|
|
Hi Idineen:
Do you have access to the source code of snmp_pdu_add_variable?
It could be that all variables are passed in as u_char*, then because of ASN_INTEGER, that function has code to convert it to an integer from the string value in test.
|
|
|
|
|
Try this:
int test = 2;
snmp_pdu_add_variable(pdu, oid, oid_length, ASN_INTEGER, reinterpret_cast<u_char*>(&test), sizeof(test));
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
|
> Should i set async read/close on the newly created socket?
The newly created socket will inherit the event mask from the server socket. It depends on the implementation of the async socket class that you use, set the events you are interested in the server socket instance and from there you create more sockets in your 'accept' handler (which will then use the same event mask).
Do not try to read data in the 'accept' handler. Have a 'read' handler which will tell you when there is (more) data available.
-- modified at 13:11 Wednesday 19th April, 2006
|
|
|
|
|
hello,
i have iexp6.0 with xp professionnel.
my code => chCtrlFrameBrowser:WebBrowser:Navigate(pcFileName,"",{&WINDOW-NAME},"","").
My problem is when i want to open a file (*.*) in a browser, it opens outside my browser and insidne my browser, it indicates a error message :
================================================================================================
Action annulée
Internet Explorer ne peut pas ouvrir la page Web requise. La page n'est peut-être pas disponible temporairement.
--------------------------------------------------------------------------------
Essayez de la manière suivante :
Cliquez sur le bouton Actualiser ou réessayez ultérieurement.
Si vous avez déjà visité cette page et souhaitez voir ce qui a été stocké sur votre ordinateur, cliquez sur Fichier, puis sur Travailler hors connexion.
Pour obtenir des informations sur la navigation hors connexion avec Internet Explorer, cliquez sur le menu ?, puis sur Sommaire et index.
Internet Explorer
=================================================================================================
Do you have any solutions.
Thanks.
MK.
|
|
|
|
|
i think you should translate what your browser tells you, because most people here speak english only...
here is the translation :
Action Canceled
Internet Explorer cannot open the requiered web page. The page may be temporarily unavailable.
------------------------------------------------------
Try the following mean :
Click the Refresh button or retry later.
If you already visited this page and wished to see what has been saved on your computer,
click on File, then Work offline.
For further informations about offline navigation with Internet Explorer, click on the ? menu, then on Contents and Index.
|
|
|
|
|
i am using InstallShield for VC++6 to create automated setup
of my project . So far i am able to create the setup.
but i have special need to create around six folders
in the default C: drive.these folders in C: drive will contains main data which my project needs.How can i do this with InstallShield for VC++6?
Fly Like An Eagle With MIGHTY POWER.
|
|
|
|
|
I have two edit controls named "name" and "location". when i enter a text in "name" edit control it shud be appended to "location" edit control.
Ex..
name : Hello
Location : c:\Desktop Search\Hello
here when the text "hello" is entered in "name" edit control,it shud be simultaneously appended with "location" edit control as shown in the example. pls help.
thanks
|
|
|
|
|
Hi sudeep_br
Name.GetWindowText(for read from Name)
Location.SetWindowText(write to Lication)
// like this
CEdit m_Edit1,m_Edit2;
CString Str,str="c:\\Desktop Search\\";
m_Edit1.GetWindowText(Str);
str.Insert(str.GetLength(),Str);
m_Edit2.SetWindowText(str);
|
|
|
|
|
i have two edit controls named "name" and "location". i also have a button called "folder select" using which users can select folders from different drives and assign it to location edit box. Theres also a "OK" button
The followind is the code i have put along with the code u provided:-
#include "stdafx.h"
#include "DesktopSearch.h"
#include "CreateDlg.h"
#include "UpdateDlg.h"
#include "FoldersDialog.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CCreateDlg dialog
CCreateDlg::CCreateDlg(CWnd* pParent /*=NULL*/)
: CDialog(CCreateDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CCreateDlg)
m_summary = -1;
//}}AFX_DATA_INIT
}
void CCreateDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CCreateDlg)
DDX_Control(pDX, IDC_FolderSelect, m_FolderSelect);
DDX_Control(pDX, IDC_Enter_Location, m_Enter_Location);
DDX_Control(pDX, IDC_Enter_Name, m_name);
DDX_Control(pDX, IDC_OK, m_ok);
DDX_Radio(pDX, IDC_Summary_only, m_summary);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CCreateDlg, CDialog)
//{{AFX_MSG_MAP(CCreateDlg)
ON_BN_CLICKED(IDC_FolderSelect, OnFolderSelect)
ON_BN_CLICKED(IDC_OK, OnOk)
ON_BN_CLICKED(IDC_Cancel, OnCancel)
ON_EN_CHANGE(IDC_Enter_Name, OnChangeEnterName)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CCreateDlg message handlers
extern TCHAR szDir[MAX_PATH];
void CCreateDlg::OnFolderSelect()
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
HWND hWnd = GetSafeHwnd();
CFoldersDialog objFD;
objFD.BrowseFolder(hWnd,m_Enter_Location);
m_Enter_Location = szDir;
UpdateData(FALSE);
}
void CCreateDlg::OnOk()
{
// TODO: Add your control notification handler code here
int iResults; // This variable will capture the button selection
// Ask the user
iResults = MessageBox("Would u like to add documetns to the index now",
"Desktop Search",MB_YESNO | MB_ICONQUESTION);
// Determine which button the user clicked
// Give the user a message showing which button was clicked
switch (iResults)
{
case IDYES: // The Yes button?
//call the Update dialog window if user press yes
m_dUpdateDlg.DoModal ();
break;
case IDNO: // The No button?
OnOK();
break;
}
}
void CCreateDlg::OnCancel()
{
code here
OnOK();
}
BOOL CCreateDlg::OnInitDialog()
{
CDialog::OnInitDialog();
UpdateData(FALSE);
CButton *pButton = (CButton*)this->GetDlgItem(IDC_OK);
pButton->EnableWindow(FALSE);
GotoDlgCtrl(GetDlgItem(IDC_OK));
return TRUE;
}
void CCreateDlg::OnChangeEnterName()
{
CButton *pButton = (CButton*)this->GetDlgItem(IDC_OK);
pButton->EnableWindow(TRUE);
CString Str,str="C:\\DesktopSearch\\Index\\";
m_name.GetWindowText(Str);
str.Insert(str.GetLength(),Str);
m_Enter_Location.SetWindowText(str);
}
The above code is giving 2 errors. both the edit control's variable typee is Cedit.
"error C2664: 'BrowseFolder' : cannot convert parameter 2 from 'class CEdit' to 'class CString'" and
"error C2582: 'CEdit' : 'operator =' function is unavailable"
pls help
Thanks
|
|
|
|
|
Hi sudeep_br,
This is a sample,I hope that help you
CEdit m_Edit1,m_Edit2;
CString m_Test1;
CString m_Test2;
m_Edit1.Create(WS_CHILD|WS_VISIBLE,CRect(0,0,100,23),this,1);
m_Edit2.Create(WS_CHILD|WS_VISIBLE,CRect(0,50,100,23),this,1);
m_Test1="C:\\DesktopSearch\\Index\\";
m_Edit1.SetWindowText(m_Test1);//Now set this string to edit1
////////Now/////////
m_Edit1.GetWindowText(m_Test2);//Read from edit1 into m_Test2 that is CString
m_Edit2.SetWindowText(m_Test2);//Now set m_Test2 to m_Edit2
//if you test this code it's fine no problem in your code
1-objFD.BrowseFolder(hWnd,m_Enter_Location);
you assain class CEdit to this function,But this function need to CString yes?
unless m_Enter_Location is CEdit well you need to get string from this Control then assain
value to function BrowseFolder.
2-I think that problem is m_Enter_Location = szDir;
m_Enter_Location is variable control(CEdit) but szDir is TCHAR
you need to m_Enter_Location.SetWindowText(szDir);
Right?
|
|
|
|
|
this is the code i put based on ur suggestion
#include "stdafx.h"
#include "DesktopSearch.h"
#include "CreateDlg.h"
#include "UpdateDlg.h"
#include "FoldersDialog.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CCreateDlg dialog
CCreateDlg::CCreateDlg(CWnd* pParent /*=NULL*/)
: CDialog(CCreateDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CCreateDlg)
m_summary = -1;
//}}AFX_DATA_INIT
}
void CCreateDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CCreateDlg)
DDX_Control(pDX, IDC_FolderSelect, m_FolderSelect);
DDX_Control(pDX, IDC_Enter_Location, m_Enter_Location);
DDX_Control(pDX, IDC_Enter_Name, m_name);
DDX_Control(pDX, IDC_OK, m_ok);
DDX_Radio(pDX, IDC_Summary_only, m_summary);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CCreateDlg, CDialog)
//{{AFX_MSG_MAP(CCreateDlg)
ON_BN_CLICKED(IDC_FolderSelect, OnFolderSelect)
ON_BN_CLICKED(IDC_OK, OnOk)
ON_BN_CLICKED(IDC_Cancel, OnCancel)
ON_EN_CHANGE(IDC_Enter_Name, OnChangeEnterName)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CCreateDlg message handlers
extern TCHAR szDir[MAX_PATH];
void CCreateDlg::OnFolderSelect()
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
HWND hWnd = GetSafeHwnd();
CFoldersDialog objFD;
CString s1;
m_Enter_Location.GetWindowText(s1);
objFD.BrowseFolder(hWnd,s1);
m_Enter_Location.SetWindowText(szDir);
UpdateData(FALSE);
}
void CCreateDlg::OnOk()
{
// TODO: Add your control notification handler code here
int iResults; // This variable will capture the button selection
// Ask the user
iResults = MessageBox("Would u like to add documetns to the index now",
"Desktop Search",MB_YESNO | MB_ICONQUESTION);
// Determine which button the user clicked
// Give the user a message showing which button was clicked
switch (iResults)
{
case IDYES: // The Yes button?
//call the Update dialog window if user press yes
m_dUpdateDlg.DoModal ();
break;
case IDNO: // The No button?
OnOK();
break;
}
}
void CCreateDlg::OnCancel()
{
// TODO: Add your control notification handler code here
OnOK();
}
BOOL CCreateDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
// m_Enter_Location = "C:\\DesktopSearch\\Index\\";
UpdateData(FALSE);
CButton *pButton = (CButton*)this->GetDlgItem(IDC_OK);
pButton->EnableWindow(FALSE);
GotoDlgCtrl(GetDlgItem(IDC_OK));
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CCreateDlg::OnChangeEnterName()
{
CButton *pButton = (CButton*)this->GetDlgItem(IDC_OK);
pButton->EnableWindow(TRUE);
CString m_Test1;
CString m_Test2;
//ERROR!!! IT SAYS CREATE CANNOT HAVE 4 PARAMETERS
m_ok.Create(WS_CHILD|WS_VISIBLE,CRect(0,0,100,23),this,1);
m_Enter_Location.Create(WS_CHILD|WS_VISIBLE,CRect(0,50,100,23),this,1);
m_Test1="C:\\DesktopSearch\\Index\\";
m_ok.SetWindowText(m_Test1);
m_ok.GetWindowText(m_Test2);
m_Enter_Location.SetWindowText(m_Test2);
}
for create it says create function cant have 4 parameters.
and to solve browsefolder problem i assigned a cstring object and passed it to browsefolder function(pls check the code)
during compilation it works fine. when i run it says "DEBUG ASSERTION FAILED"
what is wrong with my logic.pls check the code and let me know.
Thank you
|
|
|
|
|
yes because you need to caption or NULL
m_ok.Create(WS_CHILD|WS_VISIBLE,CRect(0,0,100,23),this,1);
to
m_ok.Create(NULL or "text",WS_CHILD|WS_VISIBLE,CRect(0,0,100,23),this,1);
|
|
|
|
|
#include "stdafx.h"
#include "DesktopSearch.h"
#include "CreateDlg.h"
#include "UpdateDlg.h"
#include "FoldersDialog.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CCreateDlg dialog
CCreateDlg::CCreateDlg(CWnd* pParent /*=NULL*/)
: CDialog(CCreateDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CCreateDlg)
m_summary = -1;
//}}AFX_DATA_INIT
}
void CCreateDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CCreateDlg)
DDX_Control(pDX, IDC_FolderSelect, m_FolderSelect);
DDX_Control(pDX, IDC_Enter_Location, m_Enter_Location);
DDX_Control(pDX, IDC_Enter_Name, m_name);
DDX_Control(pDX, IDC_OK, m_ok);
DDX_Radio(pDX, IDC_Summary_only, m_summary);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CCreateDlg, CDialog)
//{{AFX_MSG_MAP(CCreateDlg)
ON_BN_CLICKED(IDC_FolderSelect, OnFolderSelect)
ON_BN_CLICKED(IDC_OK, OnOk)
ON_BN_CLICKED(IDC_Cancel, OnCancel)
ON_EN_CHANGE(IDC_Enter_Name, OnChangeEnterName)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CCreateDlg message handlers
extern TCHAR szDir[MAX_PATH];
void CCreateDlg::OnFolderSelect()
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
HWND hWnd = GetSafeHwnd();
CFoldersDialog objFD;
CString s1;
m_Enter_Location.GetWindowText(s1);
objFD.BrowseFolder(hWnd,s1);
m_Enter_Location.SetWindowText(szDir);
UpdateData(FALSE);
}
void CCreateDlg::OnOk()
{
// TODO: Add your control notification handler code here
int iResults; // This variable will capture the button selection
// Ask the user
iResults = MessageBox("Would u like to add documetns to the index now",
"Desktop Search",MB_YESNO | MB_ICONQUESTION);
// Determine which button the user clicked
// Give the user a message showing which button was clicked
switch (iResults)
{
case IDYES: // The Yes button?
//call the Update dialog window if user press yes
m_dUpdateDlg.DoModal ();
break;
case IDNO: // The No button?
OnOK();
break;
}
}
void CCreateDlg::OnCancel()
{
// TODO: Add your control notification handler code here
OnOK();
}
BOOL CCreateDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
// m_Enter_Location = "C:\\DesktopSearch\\Index\\";
UpdateData(FALSE);
CButton *pButton = (CButton*)this->GetDlgItem(IDC_OK);
pButton->EnableWindow(FALSE);
GotoDlgCtrl(GetDlgItem(IDC_OK));
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CCreateDlg::OnChangeEnterName()
{
CButton *pButton = (CButton*)this->GetDlgItem(IDC_OK);
pButton->EnableWindow(TRUE);
CString m_Test1;
CString m_Test2;
//ERROR!!! IT SAYS CREATE CANNOT HAVE 4 PARAMETERS
//m_ok.Create(WS_CHILD|WS_VISIBLE,CRect(0,0,100,23),this,1);
// m_Enter_Location.Create(WS_CHILD|WS_VISIBLE,CRect(0,50,100,23),this,1);
m_Test1="C:\\DesktopSearch\\Index\\";
m_ok.SetWindowText(m_Test1);
m_ok.GetWindowText(m_Test2);
m_Enter_Location.SetWindowText(m_Test2);
}
for create it says create function cant have 4 parameters.
and to solve browsefolder problem i assigned a cstring object and passed it to browsefolder function(pls check the code)
during compilation it works fine. when i run it says "DEBUG ASSERTION FAILED"
what is wrong with my logic.pls check the code and let me know.
Thanks
|
|
|
|
|
I made changes as per ur suggestion. the following is the code
#include "stdafx.h"
#include "DesktopSearch.h"
#include "CreateDlg.h"
#include "UpdateDlg.h"
#include "FoldersDialog.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CCreateDlg dialog
CCreateDlg::CCreateDlg(CWnd* pParent /*=NULL*/)
: CDialog(CCreateDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CCreateDlg)
m_summary = -1;
//}}AFX_DATA_INIT
}
void CCreateDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CCreateDlg)
DDX_Control(pDX, IDC_FolderSelect, m_FolderSelect);
DDX_Control(pDX, IDC_Enter_Location, m_Enter_Location);
DDX_Control(pDX, IDC_Enter_Name, m_name);
DDX_Control(pDX, IDC_OK, m_ok);
DDX_Radio(pDX, IDC_Summary_only, m_summary);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CCreateDlg, CDialog)
//{{AFX_MSG_MAP(CCreateDlg)
ON_BN_CLICKED(IDC_FolderSelect, OnFolderSelect)
ON_BN_CLICKED(IDC_OK, OnOk)
ON_BN_CLICKED(IDC_Cancel, OnCancel)
ON_EN_CHANGE(IDC_Enter_Name, OnChangeEnterName)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CCreateDlg message handlers
extern TCHAR szDir[MAX_PATH];
void CCreateDlg::OnFolderSelect()
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
HWND hWnd = GetSafeHwnd();
CFoldersDialog objFD;
CString s1;
m_Enter_Location.GetWindowText(s1);
objFD.BrowseFolder(hWnd,s1);
m_Enter_Location.SetWindowText(szDir);
UpdateData(FALSE);
}
void CCreateDlg::OnOk()
{
// TODO: Add your control notification handler code here
int iResults; // This variable will capture the button selection
// Ask the user
iResults = MessageBox("Would u like to add documetns to the index now",
"Desktop Search",MB_YESNO | MB_ICONQUESTION);
// Determine which button the user clicked
// Give the user a message showing which button was clicked
switch (iResults)
{
case IDYES: // The Yes button?
//call the Update dialog window if user press yes
m_dUpdateDlg.DoModal ();
break;
case IDNO: // The No button?
OnOK();
break;
}
}
void CCreateDlg::OnCancel()
{
// TODO: Add your control notification handler code here
OnOK();
}
BOOL CCreateDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
// m_Enter_Location = "C:\\DesktopSearch\\Index\\";
UpdateData(FALSE);
CButton *pButton = (CButton*)this->GetDlgItem(IDC_OK);
pButton->EnableWindow(FALSE);
GotoDlgCtrl(GetDlgItem(IDC_OK));
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CCreateDlg::OnChangeEnterName()
{
CButton *pButton = (CButton*)this->GetDlgItem(IDC_OK);
pButton->EnableWindow(TRUE);
CString m_Test1;
CString m_Test2;
//ERROR!!! IT SAYS CREATE CANNOT HAVE 4 PARAMETERS
//m_ok.Create(WS_CHILD|WS_VISIBLE,CRect(0,0,100,23),this,1);
// m_Enter_Location.Create(WS_CHILD|WS_VISIBLE,CRect(0,50,100,23),this,1);
m_Test1="C:\\DesktopSearch\\Index\\";
m_ok.SetWindowText(m_Test1);
m_ok.GetWindowText(m_Test2);
m_Enter_Location.SetWindowText(m_Test2);
}
for create it says create function cant have 4 parameters.
and to solve browsefolder problem i assigned a cstring object and passed it to browsefolder function(pls check the code)
during compilation it works fine. when i run it says "DEBUG ASSERTION FAILED"
what is wrong with my logic.pls check the code and let me know.
Thanks
-- modified at 3:48 Thursday 13th April, 2006
|
|
|
|
|
If you add a EN_CHANGE handler for the first control, you can then read the changed text, put it on the end of location text, and update the location edit control.
ON_EN_CHANGE is the key you are looking for, I think.
Iain.
|
|
|
|
|
hi all,
I am using the following code to mute the speaker control.But i am not able to disable the speaker control.Can anyone please tell me how to do it.Disable in the sense that user should not be able to access the speaker control.
|
|
|
|
|
Sorry ,i forgot to put the code.The code is as shown below::
MMRESULT result;
HMIXER hMixer;
result = mixerOpen(&hMixer, MIXER_OBJECTF_MIXER, 0, 0, 0);
//obtain a handle to the mixer device.
if(result!=MMSYSERR_NOERROR)
{
::MessageBox(NULL,"Mixer could not be opened","1",MB_OK);
return;
}
//we need to get the speaker line of the mixer device
MIXERLINE ml = {0};
ml.cbStruct = sizeof(MIXERLINE);
ml.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS;
result = mixerGetLineInfo((HMIXEROBJ) hMixer,&ml, MIXER_GETLINEINFOF_COMPONENTTYPE);
//we need to get the volume control of the speaker line.
MIXERLINECONTROLS mlc = {0};
MIXERCONTROL mc = {0};
mlc.cbStruct = sizeof(MIXERLINECONTROLS);
mlc.dwLineID = ml.dwLineID;
mlc.dwControlType = MIXERCONTROL_CONTROLTYPE_MUTE;
mlc.cControls = 1;
mlc.pamxctrl = &mc;
mlc.cbmxctrl = sizeof(MIXERCONTROL);
result = mixerGetLineControls((HMIXEROBJ)hMixer,
&mlc, MIXER_GETLINECONTROLSF_ONEBYTYPE);
//we set the mute and unmute values
MIXERCONTROLDETAILS mcd = {0};
MIXERCONTROLDETAILS_UNSIGNED mcdu = {0};
mcdu.dwValue = 65535; //0 for unmute and //65535 for mute.
mcd.cbStruct = sizeof(MIXERCONTROLDETAILS);
mcd.hwndOwner = 0;
mcd.dwControlID = mc.dwControlID;
mcd.paDetails = &mcdu;
mcd.cbDetails = sizeof(MIXERCONTROLDETAILS_UNSIGNED);
mcd.cChannels = 1;
result = mixerSetControlDetails((HMIXEROBJ)hMixer,
&mcd, MIXER_SETCONTROLDETAILSF_VALUE);
|
|
|
|
|
ashwath2005 wrote: mcdu.dwValue = 65535; //0 for unmute and //65535 for mute.
Your comment is wrong.
So what's not working? What is the value of result ?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Sorry,Mute and Unmute are working fine.I have written the following code to disable the mute control,but it is not working.
MIXERCONTROL mc = {0};
mc.fdwControl=MIXERCONTROL_CONTROLF_DISABLED;
Please Help.
|
|
|
|
|
ashwath2005 wrote: Please Help.
I'd like to but without knowing what those functions are returning, it's not possible.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
hi,
I have written the following code for disabling the MUTE control,
MMRESULT result;
HMIXER hMixer;
result = mixerOpen(&hMixer, MIXER_OBJECTF_MIXER, 0, 0, 0);
//obtain a handle to the mixer device.
if(result!=MMSYSERR_NOERROR)
{
::MessageBox(NULL,"Mixer could not be opened","1",MB_OK);
}
//we need to get the speaker line of the mixer device
MIXERLINE ml = {0};
ml.cbStruct = sizeof(MIXERLINE);
ml.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS;
result = mixerGetLineInfo((HMIXEROBJ) hMixer,&ml, MIXER_GETLINEINFOF_COMPONENTTYPE);
if(result!=MMSYSERR_NOERROR)
{
::MessageBox(NULL,"mixerGetLineInfo failed","1",MB_OK);
}
//we need to get the volume control of the speaker line.
MIXERLINECONTROLS mlc = {0};
MIXERCONTROL mc={0};
mc.fdwControl=MIXERCONTROL_CONTROLF_DISABLED;
mlc.cbStruct = sizeof(MIXERLINECONTROLS);
mlc.dwLineID = ml.dwLineID;
mlc.dwControlType = MIXERCONTROL_CONTROLTYPE_MUTE;
mlc.cControls = 1;
mlc.pamxctrl = &mc;
mlc.cbmxctrl = sizeof(MIXERCONTROL);
result = mixerGetLineControls((HMIXEROBJ)hMixer,
&mlc, MIXER_GETLINECONTROLSF_ONEBYTYPE);
if(result!=MMSYSERR_NOERROR)
{
::MessageBox(NULL,"mixerGetLineControls failed","2",MB_OK);
}
//we set the mute and unmute values
MIXERCONTROLDETAILS mcd = {0};
MIXERCONTROLDETAILS_UNSIGNED mcdu = {0};
mcdu.dwValue =lVal; //0 for unmute and //65535 for mute.
mcd.cbStruct = sizeof(MIXERCONTROLDETAILS);
mcd.hwndOwner = 0;
mcd.dwControlID =mc.dwControlID;
mcd.paDetails = &mcdu;
mcd.cbDetails = sizeof(MIXERCONTROLDETAILS_UNSIGNED);
mcd.cChannels = 1;
result = mixerSetControlDetails((HMIXEROBJ)hMixer,
&mcd, MIXER_SETCONTROLDETAILSF_VALUE);
if(result!=MMSYSERR_NOERROR)
{
::MessageBox(NULL,"mixerSetControlDetails failed","3",MB_OK);
}
The above code does not disable the MUTE control.
I have checked all the return values,all of them return MMSYSERR_NOERROR as the return value.
Kindly help me to fix this problem.
|
|
|
|
|
ashwath2005 wrote: Kindly help me to fix this problem.
What exactly are you expecting this code to do, disable the Mute all checkbox? If so, see here.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|