directsound and WINAPI

Started by
3 comments, last by Mona777 15 years, 7 months ago
Hi, I'd be very grateful for any advice or guidance. I'm completely new to programming with directsound or windows programming. I was given a program in C++ to use but the owner is unfortunately no longer with us. The program is very complex and I'm trying to understand it from the beginning so I can work with it and develop it. The program starts with: int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) which is from what I understand the main window for windows programming. And then later on it does stuff like: LPDIRECTSOUNDCAPTUREBUFFER capBuf; LPDIRECTSOUNDCAPTURE8 soundCap; First of all why does one need WINAPI rather than just the main window in C++ in order to use directsound? secondly, are there any hardcopy or online tutorials, books, etc. that could help me with understanding the subject? Thanks very much
Advertisement
Moving to For Beginners.
Quote:Original post by Mona777
First of all why does one need WINAPI rather than just the main window in C++ in order to use directsound?

You don't necessarily need to use Windows API, but since the programs seems to directly use DirectSound API (i.e. program is Windows platform specific), it is a natural thing to use WinMain instead of C++'s main-entrypoint.

DirectSound also requires that you associate your IDirectSound8 device with a window anyway (HWND, a window handle). It's just they way it's done.

Quote:Original post by Mona777
Secondly, are there any hardcopy or online tutorials, books, etc. that could help me with understanding the subject?

Windows Platform SDK (aka. PSDK) is a good source of information about Windows programming. I suggest you to install PSDK and use the offline documentation. That way you can just type in the function name and be given documentation for that given function.

DirectX SDK contains the documentation for DirectSound and all the other Direct* APIs such as Direct3D. It too contains a very useful offline API documentation.

The Internet is probably full of tutorials about these subjects, but if you really want to understand the workings of the program and develop it further, I would suggest you to analyse the source code and consult the documentations when unsure about something...

Hope this helps.
I thought this was the FOR BEGINNERS site!
Thanks ever so much VHL. That's great help. :O)

This topic is closed to new replies.

Advertisement