Help with Direct Music

This is a discussion on Help with Direct Music within the Game Programming forums, part of the General Programming Boards category; hi all, im using dev c++ 4.9.8.0 on windows xp with dx9 sdk but every time i try to compile ...

  1. #1
    Registered User
    Join Date
    Jul 2002
    Posts
    35

    Help with Direct Music

    hi all,
    im using dev c++ 4.9.8.0 on windows xp with dx9 sdk but every time i try to compile with the include dmusici.h i get errors even with a blank template grrrr.please help me this is the source:-



    Code:
    #include <windows.h>
    #include <dmusici.h>
    
    /*  Declare Windows procedure  */
    LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);
    
    /*  Make the class name into a global variable  */
    char szClassName[ ] = "WindowsApp";
    
    int WINAPI WinMain (HINSTANCE hThisInstance,
                        HINSTANCE hPrevInstance,
                        LPSTR lpszArgument,
                        int nFunsterStil)
    
    {
        HWND hwnd;               /* This is the handle for our window */
        MSG messages;            /* Here messages to the application are saved */
        WNDCLASSEX wincl;        /* Data structure for the windowclass */
    
        /* The Window structure */
        wincl.hInstance = hThisInstance;
        wincl.lpszClassName = szClassName;
        wincl.lpfnWndProc = WindowProcedure;      /* This function is called by windows */
        wincl.style = CS_DBLCLKS;                 /* Catch double-clicks */
        wincl.cbSize = sizeof (WNDCLASSEX);
    
        /* Use default icon and mouse-pointer */
        wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION);
        wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
        wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
        wincl.lpszMenuName = NULL;                 /* No menu */
        wincl.cbClsExtra = 0;                      /* No extra bytes after the window class */
        wincl.cbWndExtra = 0;                      /* structure or the window instance */
        /* Use Windows's default color as the background of the window */
        wincl.hbrBackground = (HBRUSH) COLOR_BACKGROUND;
    
        /* Register the window class, and if it fails quit the program */
        if (!RegisterClassEx (&wincl))
            return 0;
    
        /* The class is registered, let's create the program*/
        hwnd = CreateWindowEx (
               0,                   /* Extended possibilites for variation */
               szClassName,         /* Classname */
               "Windows App",       /* Title Text */
               WS_OVERLAPPEDWINDOW, /* default window */
               CW_USEDEFAULT,       /* Windows decides the position */
               CW_USEDEFAULT,       /* where the window ends up on the screen */
               544,                 /* The programs width */
               375,                 /* and height in pixels */
               HWND_DESKTOP,        /* The window is a child-window to desktop */
               NULL,                /* No menu */
               hThisInstance,       /* Program Instance handler */
               NULL                 /* No Window Creation data */
               );
    
        /* Make the window visible on the screen */
        ShowWindow (hwnd, nFunsterStil);
    
        /* Run the message loop. It will run until GetMessage() returns 0 */
        while (GetMessage (&messages, NULL, 0, 0))
        {
            /* Translate virtual-key messages into character messages */
            TranslateMessage(&messages);
            /* Send message to WindowProcedure */
            DispatchMessage(&messages);
        }
    
        /* The program return-value is 0 - The value that PostQuitMessage() gave */
        return messages.wParam;
    }
    
    
    /*  This function is called by the Windows function DispatchMessage()  */
    
    LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
    {
        switch (message)                  /* handle the messages */
        {
            case WM_DESTROY:
                PostQuitMessage (0);       /* send a WM_QUIT to the message queue */
                break;
            default:                      /* for messages that we don't deal with */
                return DefWindowProc (hwnd, message, wParam, lParam);
        }
    
        return 0;
    }
    and these are the errors :-

    81 C:\DXSDK\Include\dmdls.h
    declaration of `WLOOP _DMUS_REGION::WLOOP[0]'
    264 C:\DXSDK\Include\dls1.h
    changes meaning of `WLOOP' from `typedef struct

    thx in advanced

  2. #2
    Banned frenchfry164's Avatar
    Join Date
    Oct 2001
    Posts
    1,552
    did you link with the correct libraries?

  3. #3
    mov.w #$1337,D0 Jeremy G's Avatar
    Join Date
    Nov 2001
    Posts
    704
    Dont use Direct Music. Its lame. FMOD is the best. and so easy too.
    c++->visualc++->directx->opengl->c++;
    (it should be realized my posts are all in a light hearted manner. And should not be taken offense to.)

  4. #4
    Banned frenchfry164's Avatar
    Join Date
    Oct 2001
    Posts
    1,552
    wow dude, thx for trying to help him with his problem with DIRECTMUSIC. He didn't ask for opinions, he asked for help.

  5. #5
    mov.w #$1337,D0 Jeremy G's Avatar
    Join Date
    Nov 2001
    Posts
    704
    Originally posted by frenchfry164
    wow dude, thx for trying to help him with his problem with DIRECTMUSIC. He didn't ask for opinions, he asked for help.


    Shut up, freedom fry.





    I am helping the poster by providing far more valuable information.
    c++->visualc++->directx->opengl->c++;
    (it should be realized my posts are all in a light hearted manner. And should not be taken offense to.)

  6. #6
    Banned frenchfry164's Avatar
    Join Date
    Oct 2001
    Posts
    1,552
    so if you was making a RTS game and you had problems with it, would it help out any if someone posted "Screw that dude, just make a First Person Shooter, they are funner and cooler"

  7. #7
    Registered User
    Join Date
    Jul 2002
    Posts
    35
    hahahah yea answer my question !! not tell me other junk :P what libraries are they ?
    Theres a sucker born every minute, but a swallower is harder to find

  8. #8
    Banned frenchfry164's Avatar
    Join Date
    Oct 2001
    Posts
    1,552
    Dxguid.lib

  9. #9
    Registered User
    Join Date
    Jul 2002
    Posts
    35
    yea i linked that and i still get that error =/
    Theres a sucker born every minute, but a swallower is harder to find

  10. #10
    Programming Sex-God Polymorphic OOP's Avatar
    Join Date
    Nov 2002
    Posts
    1,078
    Originally posted by dbgt goten
    Dont use Direct Music. Its lame. FMOD is the best. and so easy too.
    ...

    If you are working in windows, unless you want to load mod files (which you really shouldn't, in most cases), DirectMusic is the way to go. While FMOD does encapsulate some of DirectMusic's features, it completely misses the biggest benefits of DirectMusic, namely their superior proprietary formats. The DirectMusic formats are the most flexible and interactive forms of music available today, period. No other formats even come close.

  11. #11
    Registered User
    Join Date
    Jul 2002
    Posts
    35
    yes i am using windows and i do want to use direct music and it bugging me why it wont work grrr im still listening for any help or advice ABOUT direct music or if any body has done it b4 and got it working if they could send me there code i can have a look
    Theres a sucker born every minute, but a swallower is harder to find

  12. #12
    Programming Sex-God Polymorphic OOP's Avatar
    Join Date
    Nov 2002
    Posts
    1,078
    I just checked the header -- that's Microsoft's fault for writing nonstandard code, unfortunately. There's nothing you can do about it except use the MS Compiler, which, unfortunately, is ass My recommendation -- go to MSDN and $$$$$ in the forums so they fix it for the next SDK release

    EDIT: hmmm, nm -- it's not nonstandard! looks as if g++ just can't handle it! Apparently you can make a member of a structure have the same name as it's datatype, which is something I previously did not know! Learn sometihng new every day, I guess. So, $$$$$ at the makers of g++ instead
    Last edited by Polymorphic OOP; 04-08-2003 at 04:25 AM.

  13. #13
    Registered User
    Join Date
    Jul 2002
    Posts
    35
    so what do i have to do to get it working or is there nothing =/

    btw i never knew msdn had forums :S
    Last edited by poopy_pants2; 04-08-2003 at 04:38 AM.
    Theres a sucker born every minute, but a swallower is harder to find

  14. #14
    Programming Sex-God Polymorphic OOP's Avatar
    Join Date
    Nov 2002
    Posts
    1,078
    Originally posted by poopy_pants2
    so what do i have to do to get it working or is there nothing =/
    All you can do for now is use another compiler . You can try to edit the structure definition and change the member name, but that will potentially make other code not compile. If that doesn't work, you're outa luck.

    Originally posted by poopy_pants2
    btw i never knew msdn had forums :S
    They do, at least they used to. I'll see if I can get a link for ya.

    EDIT: doesn't look like it's there anymore
    Last edited by Polymorphic OOP; 04-08-2003 at 04:48 AM.

  15. #15
    Registered User
    Join Date
    Jul 2002
    Posts
    35
    ah well thx for all ya help ill mess around with code and if i get it working ill tell ya
    Theres a sucker born every minute, but a swallower is harder to find

Page 1 of 2 12 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Music Programming - Serial Matrix Display (Help needed)
    By CrazyHorse in forum C Programming
    Replies: 1
    Last Post: 11-13-2007, 03:28 PM
  2. Is AOL music crazy?
    By joeprogrammer in forum A Brief History of Cprogramming.com
    Replies: 9
    Last Post: 03-24-2006, 06:24 PM
  3. Direct Input shutting down improperly
    By Deo in forum Game Programming
    Replies: 3
    Last Post: 06-14-2005, 06:54 AM
  4. Direct Music Illegal Static Member Call error
    By FwyWice in forum Game Programming
    Replies: 4
    Last Post: 11-30-2002, 04:14 PM
  5. Direct Music Trouble
    By FwyWice in forum Game Programming
    Replies: 5
    Last Post: 11-29-2002, 03:01 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21