Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
R

redeemer

@redeemer
About
Posts
199
Topics
81
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Please help. How do i use acmFormatEnum?
    R redeemer

    I'm trying to enumerate all the different formats for a specific format type, but every time i run the acmFormatEnum function it returns MMSYSERR_INVALPARAM meaning "At least one parameter is invalid.". Anyone know how to use that function? Anyone have some examples? All help is greatly appreciated, here's my code. I start by running the TagEnum function:

    ACMFORMATTAGDETAILS acmTagDetails;

    void TagEnum()
    {
    HACMDRIVER hAcm;

    acmDriverOpen(&hAcm, id, 0);
    
    acmTagDetails.cbStruct = sizeof(ACMFORMATTAGDETAILS);
    acmFormatTagEnum(hAcm, &acmTagDetails, acmTagCallback, NULL, 0);
    
    acmDriverClose(hAcm, 0);
    

    }

    BOOL WINAPI acmTagCallback(HACMDRIVERID hadid, LPACMFORMATTAGDETAILS paftd, DWORD dwInstance,DWORD fdwSupport)
    {
    ACMFORMATDETAILS acmFormat;
    WAVEFORMATEX waveFormat = { 0 };
    HACMDRIVER hAcm;

    memset(&acmFormat, 0, sizeof(acmFormat));
    acmFormat.cbStruct = sizeof(acmFormat);
    acmFormat.cbwfx = sizeof(waveFormat);
    acmFormat.pwfx = &waveFormat;
    acmFormat.dwFormatTag = acmTagDetails.dwFormatTag;
    
    waveFormat.wFormatTag = acmTagDetails.dwFormatTag;
    
    acmDriverOpen(&hAcm, hadid, 0);
    acmFormatEnum(hAcm, &acmFormat, formatCallback, NULL, ACM\_FORMATENUMF\_WFORMATTAG);
    acmDriverClose(hAcm, 0);
    
    return TRUE;
    

    }

    BOOL WINAPI formatCallback(HACMDRIVERID hadid, LPACMFORMATDETAILS pafd, DWORD dwInstance, DWORD fdwSupport)
    {
    ACMDRIVERDETAILS details;

    details.cbStruct = sizeof(details);
    
    acmDriverDetails(hadid, &details, NULL);
    
    SendMessage(GetDlgItem(ghWnd, IDC\_FORMATS), LB\_INSERTSTRING, 0, (LPARAM)details.szLongName);
    
    return TRUE;
    

    }

    id is a HACMDRIVERID holding a valid driver id of a driver. Anyone have a clue what could be wrong or have some examples? All help is apprecaited. -Rune Svendsen

    C / C++ / MFC question help tutorial

  • INVALID_SET_FILE_POINTER isn't declared anywhere...
    R redeemer

    When i try to compile a program, VirtualDub actually (www.virtualdub.com), it says that INVALID_SET_FILE_POINTER is an unknown identifier. Accoring to MSDN it's defined in winbase.h (include windows.h) but when i search for that phrase (INVALID_SET_FILE_POINTER) in my include folder, no results are found. Anyone know what could be wrong? Thanks

    C / C++ / MFC com question

  • MSDN example code generates hard-coded brekapoint.
    R redeemer

    Are they sent to my email or what? cause my email address is runes@hotpop.com

    C / C++ / MFC debugging help tutorial question

  • MSDN example code generates hard-coded brekapoint.
    R redeemer

    Sure, can i get your email address?

    C / C++ / MFC debugging help tutorial question

  • MSDN example code generates hard-coded brekapoint.
    R redeemer

    It's a WAVEFORMATEX structure used to restrict the formats showed, so only 16-bits per sample formats are showed in the list.

    C / C++ / MFC debugging help tutorial question

  • MSDN example code generates hard-coded brekapoint.
    R redeemer

    I just tried to run some code i got directly from MSDN, non-modified, but at the acmFormatChoose line it gives me a message about a "breakpoint called from code at 0xXXXXXX", anyone have a clue what's wrong?

    MMRESULT mmr;
    ACMFORMATCHOOSE afc;
    WAVEFORMATEX wfxSelection;
    WAVEFORMATEX wfxEnum;

    // Initialize the ACMFORMATCHOOSE members.
    memset(&afc, 0, sizeof(afc));

    afc.cbStruct = sizeof(afc);
    afc.fdwStyle = 0L; // no special style flags
    afc.hwndOwner = ghWnd; // hwnd of parent window
    afc.pwfx = &wfxSelection; // wfx to receive selection
    afc.cbwfx = sizeof(wfxSelection);
    afc.pszTitle = TEXT("16 Bit PCM Selection");

    // Request that all 16-bit PCM formats be displayed for the user
    // to select from.
    memset(&wfxEnum, 0, sizeof(wfxEnum));

    wfxEnum.wFormatTag = WAVE_FORMAT_PCM;
    wfxEnum.wBitsPerSample = 16;

    afc.fdwEnum = ACM_FORMATENUMF_WFORMATTAG | ACM_FORMATENUMF_WBITSPERSAMPLE;
    afc.pwfxEnum = &wfxEnum;

    mmr = acmFormatChoose(&afc);
    if ((MMSYSERR_NOERROR != mmr) && (ACMERR_CANCELED != mmr))
    {
    // There was a fatal error in bringing up the list
    // dialog box (probably invalid input parameters).
    }

    Thankyou in advance. -Rune Svendsen

    C / C++ / MFC debugging help tutorial question

  • Unhandled exception when using acmFormatChoose.
    R redeemer

    I have some code where i try to display a dialog box where a user can choose a specific format. I've filled all the parts of the struct that needs to be filled accoring to the MSDN, but still i get an unhandled exception when running the function. Here's my code:

    ACMFORMATCHOOSE acmChoose;
    WAVEFORMATEX fmtChoose = { 0 };

    acmChoose.pwfx = &fmtChoose;
    acmChoose.cbwfx = sizeof(fmtChoose);
    acmChoose.cbStruct = sizeof(acmChoose);
    acmChoose.hwndOwner = ghWnd;

    acmFormatChoose(&acmChoose);

    Where ghWnd is a valid handle to my main window. Anyone know what could be wrong? Thankyou all, all input is appreciated. -Rune Svendsen

    C / C++ / MFC question

  • How do i use acmFormatEnum? All help is appreciated!
    R redeemer

    I'm trying to enumerate all the different formats of a specific driver but acmFormatEnum keeps returning MMSYSERR_INVALPARAM (At least one parameter is invalid.). Anyone have an example of how to do this? Here's my code (id is a valid driver identifier of a driver):

    ACMFORMATTAGDETAILS acmTagDetails;

    void StartEnum()
    {
    HACMDRIVER hAcm;

    acmDriverOpen(&hAcm, id, 0);
    
    acmTagDetails.cbStruct = sizeof(ACMFORMATTAGDETAILS);
    acmFormatTagEnum(hAcm, &acmTagDetails, acmTagCallback, NULL, 0);
    
    acmDriverClose(hAcm, 0);
    

    }

    BOOL WINAPI acmTagCallback(HACMDRIVERID hadid, LPACMFORMATTAGDETAILS paftd, DWORD dwInstance,DWORD fdwSupport)
    {
    ACMFORMATDETAILS acmFormat;
    HACMDRIVER hAcm;

    memset(&acmFormat, 0, sizeof acmFormat);
    acmFormat.cbStruct = sizeof(ACMFORMATDETAILS);
    acmMetrics(NULL, ACM\_METRIC\_MAX\_SIZE\_FORMAT, &acmFormat.cbwfx);
    acmFormat.pwfx = (WAVEFORMATEX \*)malloc(acmFormat.cbwfx);
    
    acmDriverOpen(&hAcm, hadid, 0);
    acmFormatEnum(hAcm, &acmFormat, formatCallback, NULL, ACM\_FORMATENUMF\_WFORMATTAG);
    acmDriverClose(hAcm, 0);
    
    return TRUE;
    

    }

    BOOL WINAPI formatCallback(HACMDRIVERID hadid, LPACMFORMATDETAILS pafd, DWORD dwInstance, DWORD fdwSupport)
    {
    ACMDRIVERDETAILS details;

    details.cbStruct = sizeof(details);
    
    acmDriverDetails(hadid, &details, NULL);
    
    SendMessage(GetDlgItem(ghWnd, IDC\_FORMATS), LB\_INSERTSTRING, 0, (LPARAM)details.szLongName);
    
    return TRUE;
    

    }

    Thanks for your help! -Rune Svendsen

    C / C++ / MFC tutorial question help

  • User breakpoint called from code. Please help!
    R redeemer

    umm, not sure if it makes much sense, but this is the contens of it when the message appears: NTDLL! 77f9f9df() NTDLL! 77fb4966() NTDLL! 77fb3bdc() NTDLL! 77fa7131() NTDLL! 77fca4cb() MSMS001! 01ac7b68() MSMS001! 01ac7539() MSMS001! 01abfcf7() VCT3216! 01254326()

    C / C++ / MFC help debugging

  • User breakpoint called from code. Please help!
    R redeemer

    1. I have tried removing everything from the callback function except return true;, and when i do that the messagebox doesn't appear, but in the Debug fan (the one where there's Build, Debug, Find In Files 1 etc.) it says First-chance exception in MP3.exe (MSACM32.DLL): 0xC0000005: Access Violation. First-chance exception in MP3.exe (MSACM32.DLL): 0xC0000005: Access Violation. (yes, the statement is shown twice) 2. The line where i call the function that uses the callback function is as follows:

    acmDriverEnum(listCallback, NULL, ACM_DRIVERENUMF_DISABLED);

    The prototype of the callback is:

    BOOL WINAPI listCallback (HACMDRIVERID hadid, DWORD dwInstance, DWORD fdwSupport);

    but that is actually not the original callback function definition, it's like this:

    BOOL ACMDRIVERENUMCB acmDriverEnumCallback(HACMDRIVERID hadid, DWORD dwInstance, DWORD fdwSupport);

    the reason i changed it was that it wouldn't compile when i used ACMDRIVERENUMCB, a lot of compile errors showed. so i asked what could be wrong and one said that maby ACMDRIVERENUMCB was just a typedef of WINAPI so i used that, could that be where the problem lies? Thanks for your help.

    C / C++ / MFC help debugging

  • User breakpoint called from code. Please help!
    R redeemer

    Sorry for my ignorance, but what is the call stack and how to i review it? Thanks.

    C / C++ / MFC help debugging

  • User breakpoint called from code. Please help!
    R redeemer

    I get this error when using acmDriverEnum to enumerate all the different codecs on my system, this is the callback function:

    BOOL WINAPI listCallback(HACMDRIVERID hadid, DWORD dwInstance, DWORD fdwSupport)
    {
    if (fdwSupport & ACMDRIVERDETAILS_SUPPORTF_CODEC)
    {
    ACMDRIVERDETAILS details;

    	details.cbStruct = sizeof(details);
    
    	acmDriverDetails(hadid, &details, NULL);
    
    	SendMessage(GetDlgItem(ghWnd, IDC\_CODECS), LB\_INSERTSTRING, 0, (LPARAM)details.szLongName);
    }
    
    return true;
    

    }

    In this routine i simply check if the current driver is a codec, and if it is i add the name of it to a listbox. The error happens when i have looped though all of the different codecs and the return true; statement has been executed. After that it jumps to some assembly code, and this is the stament it gives me the message after completing:

    call dword ptr [ebp+8]

    When that statement has been executed, the "User breakpoint called from code at 0x77f9f9df" message appears, and it jumps to this statement:

    int 3

    I've never experienced this message before and i haven't got a clue what it means. All help appreciated. -Rune Svendsen

    C / C++ / MFC help debugging

  • User breakpoint called from code at 0x77f9f9df
    R redeemer

    What does that mean? The messagebox appears and it goes into assembly debugging, i'm trying to enumerate all the available compression driver on the system, here's the code:

    void onConvert()
    {
    acmDriverEnum((ACMDRIVERENUMCB)listCallback, NULL, ACM_DRIVERENUMF_DISABLED);
    }

    BOOL WINAPI listCallback(HACMDRIVERID hadid, DWORD dwInstance, DWORD fdwSupport)
    {
    if (fdwSupport == ACMDRIVERDETAILS_SUPPORTF_CODEC)
    {
    ACMDRIVERDETAILS details;
    int box;
    int test;
    details.cbStruct = sizeof(details);

    	box = acmDriverDetails(hadid, &details, NULL);
    
    	SendMessage(GetDlgItem(ghWnd, IDC\_CODECS), LB\_ADDSTRING, 0, (LPARAM)details.szLongName);
    }
    
    return true;
    

    }

    First i call the onConvert and then it uses the listCallback function to enumerate the different drivers. Thanks in advance -Redeemer

    C / C++ / MFC debugging question

  • Can't figure out these compile errors.
    R redeemer

    Thankyou! Solved it all!

    C / C++ / MFC help csharp visual-studio tutorial

  • Can't figure out these compile errors.
    R redeemer

    I'm making a list of all the available audio decoders in the system by calling acmDriverEnum, but i get some compile errors that i can't figure out how to get rid of, here's the callback prototype:

    BOOL ACMDRIVERENUMCB listCallback(HACMDRIVERID hadid, DWORD dwInstance, DWORD fdwSupport);

    and here's the callback function (not finished yet, i just want it to compile):

    BOOL ACMDRIVERENUMCB listCallback(HACMDRIVERID hadid, DWORD dwInstance, DWORD fdwSupport)
    {
    if (fwdSupport == ACMDRIVERDETAILS_SUPPORTF_CODEC)
    {
    ACMDRIVERDETAILS details;

    	acmDriverDetails(hadid, &details, 0);
    }
    

    }

    these are the compile errors i get: e:\mp3organizer\convertaudio\main.h(5) : error C2146: syntax error : missing ';' before identifier 'listCallback' e:\mp3organizer\convertaudio\main.h(5) : error C2377: 'ACMDRIVERENUMCB' : redefinition; typedef cannot be overloaded with any other symbol e:\program files\microsoft visual studio\vc98\include\msacm.h(250) : see declaration of 'ACMDRIVERENUMCB' e:\mp3organizer\convertaudio\main.h(5) : fatal error C1004: unexpected end of file found All help appreciated, thankyou.

    C / C++ / MFC help csharp visual-studio tutorial

  • ACM audio compression turorial.
    R redeemer

    Anyone know a good ACM audio compression turorial? Thanks in advance.

    C / C++ / MFC question

  • Open Filename dialog won't show.
    R redeemer

    I'm trying to show an Open File dialog but it won't show and i can't figure out what i'm doing wrong, here's the code:

    {
    OPENFILENAME ofn;
    char szFileNames[(MAX_PATH+1)*1000+2];
    const char szFilter[] = "MP3 Files (*.mp3)\0" "*.mp3\0";

    szFileNames\[0\] = 0;
    ofn.lStructSize = sizeof(OPENFILENAME);
    
    ofn.hwndOwner = ghWnd;
    ofn.lpstrFilter = szFilter;
    ofn.lpstrCustomFilter = (LPSTR)NULL;
    ofn.nFilterIndex = 1;
    ofn.lpstrFile = szFileNames;
    ofn.nMaxFile = sizeof(szFileNames);
    ofn.lpstrFileTitle = NULL;
    ofn.lpstrTitle = (LPSTR)NULL;
    ofn.Flags = OFN\_ENABLESIZING | OFN\_FILEMUSTEXIST | OFN\_HIDEREADONLY | OFN\_PATHMUSTEXIST | OFN\_ALLOWMULTISELECT | OFN\_EXPLORER;
    ofn.nFileOffset = 0;
    ofn.nFileExtension = 0;
    ofn.lpstrDefExt = "mp3";
    
    GetOpenFileName(&ofn);
    

    Thanks in advance -Rune Svendsen

    C / C++ / MFC

  • 102 compiling errors in commdlg.h
    R redeemer

    WHen i try to compile a program including commdlg.h i get 102 compiling errors. almost everyone of them are because of undeclared identifiers like APIENTRY, UINT and DWORD. i don't understand why it gives me so many errors and why it can't recognize DWORD and UINT. what's wrong?

    C / C++ / MFC question

  • GetOpenFileName unhandled exception.
    R redeemer

    Thanks, it was the lpstrInitialDir.

    C / C++ / MFC

  • GetOpenFileName unhandled exception.
    R redeemer

    here's the code, when i get to the GetOpenFileName line it gives me an unhandled exception, i can't figure out what's wrong, here's the code:

    void OnBrowse()
    {
    OPENFILENAME ofn;
    char szFileName[MAX_PATH+1];
    const char szFilter[] = "All Files (*.*)\0" "*.*\0";

    szFileName\[0\] = '\\0';
    ofn.lStructSize = sizeof(OPENFILENAME);
    
    ofn.hwndOwner = ghWnd;
    ofn.lpstrFilter = szFilter;
    ofn.lpstrCustomFilter = (LPSTR)NULL;
    ofn.nFilterIndex = 1;
    ofn.lpstrFile = szFileName;
    ofn.nMaxFile = sizeof(szFileName);
    ofn.lpstrFileTitle = NULL;
    ofn.lpstrTitle = (LPSTR)NULL;
    ofn.Flags = OFN\_ENABLESIZING | OFN\_FILEMUSTEXIST | OFN\_HIDEREADONLY | OFN\_PATHMUSTEXIST | OFN\_EXPLORER;
    ofn.nFileOffset = 0;
    ofn.nFileExtension = 0;
    ofn.lpstrDefExt = "txt";
    
    
    if (GetOpenFileName(&ofn))
    	SetDlgItemText(ghWnd, IDC\_LIST, szFileName);
    

    }

    Thanks in advance. -Rune Svendsen

    C / C++ / MFC
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups