Click here to Skip to main content
15,921,793 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Database Easy Question Pin
David Crow1-Jul-03 6:09
David Crow1-Jul-03 6:09 
GeneralRe: Database Easy Question Pin
Toni781-Jul-03 18:58
Toni781-Jul-03 18:58 
GeneralModeless Dialogs Pin
Jay Hova1-Jul-03 5:35
Jay Hova1-Jul-03 5:35 
GeneralRe: Modeless Dialogs Pin
valikac1-Jul-03 5:39
valikac1-Jul-03 5:39 
GeneralRe: Modeless Dialogs Pin
David Crow1-Jul-03 6:23
David Crow1-Jul-03 6:23 
GeneralRe: Modeless Dialogs Pin
Jay Hova1-Jul-03 6:37
Jay Hova1-Jul-03 6:37 
GeneralProblem with COMIP.H Pin
ThaisFurlan1-Jul-03 5:01
ThaisFurlan1-Jul-03 5:01 
Generalaudio settings in xp - help Pin
alonk1-Jul-03 4:29
alonk1-Jul-03 4:29 
hi,
i have the following code that works fine on win98,2000 and NT.
In windows XP it changes the recording channel from microphone to the line-in and i dont know why.
can anyone help?

if ( !m_bInitialized )
return;
bool bAnyEnabled = false;
MMRESULT mmResult;

MIXERLINE lineDestination;
memset( &lineDestination, 0, sizeof(MIXERLINE) );
lineDestination.cbStruct = sizeof(MIXERLINE);
lineDestination.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_WAVEIN;
mmResult = mixerGetLineInfo( (HMIXEROBJ)m_dwMixerHandle, &lineDestination, MIXER_GETLINEINFOF_COMPONENTTYPE );
if ( mmResult != MMSYSERR_NOERROR )
{
TRACE(".InputMicVolume: FAILURE: Could not get the Destination Line while enabling. mmResult=%d\n", mmResult );
return;
}
// Getting all line's controls
int nControlCount = lineDestination.cControls;
int nChannelCount = lineDestination.cChannels;
MIXERLINECONTROLS LineControls;
memset( &LineControls, 0, sizeof(MIXERLINECONTROLS) );
MIXERCONTROL* aControls = (MIXERCONTROL*)malloc( nControlCount * sizeof(MIXERCONTROL) );
if ( !aControls )
{
TRACE(".InputMicVolume: FAILURE: Out of memory while enabling the line.\n" );
return;
}
memset( &aControls[0], 0, sizeof(nControlCount * sizeof(MIXERCONTROL)) );
for ( int i = 0; i < nControlCount; i++ )
{
aControls[i].cbStruct = sizeof(MIXERCONTROL);
}
LineControls.cbStruct = sizeof(MIXERLINECONTROLS);
LineControls.dwLineID = lineDestination.dwLineID;
LineControls.cControls = nControlCount;
LineControls.cbmxctrl = sizeof(MIXERCONTROL);
LineControls.pamxctrl = &aControls[0];
mmResult = mixerGetLineControls( (HMIXEROBJ)m_dwMixerHandle, &LineControls, MIXER_GETLINECONTROLSF_ALL );
if ( mmResult == MMSYSERR_NOERROR )
{
for ( i = 0; i < nControlCount; i++ )
{
if ( aControls[i].dwControlType & MIXERCONTROL_CT_UNITS_BOOLEAN )
{
MIXERCONTROLDETAILS_BOOLEAN* aDetails = NULL;
int nMultipleItems = aControls[i].cMultipleItems;
int nChannels = nChannelCount;
// MIXERCONTROLDETAILS
MIXERCONTROLDETAILS ControlDetails;
memset( &ControlDetails, 0, sizeof(MIXERCONTROLDETAILS) );
ControlDetails.cbStruct = sizeof(MIXERCONTROLDETAILS);
ControlDetails.dwControlID = aControls[i].dwControlID;

if ( aControls[i].fdwControl & MIXERCONTROL_CONTROLF_UNIFORM )
{
nChannels = 1;
}

if ( aControls[i].fdwControl & MIXERCONTROL_CONTROLF_MULTIPLE )
{
nMultipleItems = aControls[i].cMultipleItems;
aDetails = (MIXERCONTROLDETAILS_BOOLEAN*)malloc(nMultipleItems*nChannels*sizeof(MIXERCONTROLDETAILS_BOOLEAN));
if ( !aDetails )
{
TRACE(".InputMicVolume: FAILURE: Out of memory while enabling the line.\n" );
continue;
}
for ( int nItem = 0; nItem < nMultipleItems; nItem++ )
{
LONG lValue = FALSE;
if ( nItem == (int)m_uSourceLineIndex )
lValue = TRUE;
for ( int nChannel = 0; nChannel < nChannels; nChannel++ )
{
aDetails[nItem+nChannel].fValue = lValue;
}
}

ControlDetails.cChannels = nChannels;
ControlDetails.cMultipleItems = nMultipleItems;
ControlDetails.cbDetails = sizeof(MIXERCONTROLDETAILS_BOOLEAN);
ControlDetails.paDetails = &aDetails[0];
mmResult = mixerSetControlDetails( (HMIXEROBJ)m_dwMixerHandle, &ControlDetails, 0L );
if ( mmResult == MMSYSERR_NOERROR )
{
TRACE(".InputMicVolume: Enabling Line: Line control \"%s\" has been enabled.\n", aControls[i].szShortName );
bAnyEnabled = true;
}
free( aDetails );

}
}
}
} else {
TRACE(".InputMicVolume: FAILURE: Could not get the line's controls while enabling. mmResult=%d\n", mmResult );
}
free( aControls );
if ( !bAnyEnabled )
{
TRACE(".InputMicVolume: WARNING: No controls were found for enabling the line.\n" );
}
Generalprinting multiple pages spanning horizontally Pin
Member 4509901-Jul-03 4:28
Member 4509901-Jul-03 4:28 
GeneralRe: printing multiple pages spanning horizontally Pin
basementman1-Jul-03 5:05
basementman1-Jul-03 5:05 
GeneralRe: printing multiple pages spanning horizontally Pin
Member 4509901-Jul-03 5:11
Member 4509901-Jul-03 5:11 
GeneralRe: printing multiple pages spanning horizontally Pin
Member 4509902-Jul-03 6:42
Member 4509902-Jul-03 6:42 
GeneralHHEELLPP!!! Pin
Sunnygirl1-Jul-03 3:57
Sunnygirl1-Jul-03 3:57 
GeneralRe: HHEELLPP!!! Pin
noksi1-Jul-03 4:59
noksi1-Jul-03 4:59 
GeneralRe: HHEELLPP!!! Pin
Terry O'Nolley10-Jul-03 11:36
Terry O'Nolley10-Jul-03 11:36 
Generalresizing an array to the size of another array Pin
johnstonsk1-Jul-03 3:50
johnstonsk1-Jul-03 3:50 
GeneralRe: resizing an array to the size of another array Pin
John M. Drescher1-Jul-03 4:21
John M. Drescher1-Jul-03 4:21 
GeneralRe: resizing an array to the size of another array Pin
David Crow1-Jul-03 6:27
David Crow1-Jul-03 6:27 
GeneralSetWindowRgn With CButton Pin
nlecren1-Jul-03 3:47
nlecren1-Jul-03 3:47 
GeneralRe: SetWindowRgn With CButton Pin
basementman1-Jul-03 4:53
basementman1-Jul-03 4:53 
GeneralRe: SetWindowRgn With CButton Pin
nlecren1-Jul-03 10:57
nlecren1-Jul-03 10:57 
GeneralRe: SetWindowRgn With CButton Pin
basementman1-Jul-03 11:57
basementman1-Jul-03 11:57 
QuestionGetBuffer?? ReleaseBuffer?? Pin
skinnyreptile1-Jul-03 3:30
skinnyreptile1-Jul-03 3:30 
AnswerRe: GetBuffer?? ReleaseBuffer?? Pin
David Crow1-Jul-03 3:48
David Crow1-Jul-03 3:48 
GeneralRe: GetBuffer?? ReleaseBuffer?? Pin
skinnyreptile1-Jul-03 4:28
skinnyreptile1-Jul-03 4:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.