Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

dansteph

Directsound dll ? heeeeeeelp

This topic is 5934 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I try to include directsound in a dll while i''m experienced with dx programming this is the first time I mess with dll. All is well until I call: LPDIRECTSOUND8 m_pDS; DirectSoundCreate8( NULL, &m_pDS, NULL ); //OK m_pDS->SetCooperativeLevel( hWnd, dwCoopLevel ); here it say: ''SetCooperativeLevel'' : is not a member of ''IDirectSound8'' and so on for : ''CreateSoundBuffer'' : is not a member of ''IDirectSound8'' When I browse the function I see that it look about: IDirectSound8Vtbl::CreateSoundBuffer This let me think that is a DLL problem ? How can one mix dll and directsound (for info it''s for a fs2002 gauge) Any hint appreciated Dan

Share this post


Link to post
Share on other sites
Advertisement
Make sure CINTERFACE is not #defined, and that your file has .cpp extension. Can you do this:

m_pDS->lpVtbl->SetCooperativeLevel( m_pDS, hWnd, dwCoopLevel );

If you can, the interfaces are expanded to their C version rather than C++ ones.

Share this post


Link to post
Share on other sites
Gee a fast reply :-) thanks for it.

gauge are plain c but i did found an old article
and this compile well:


    
// Create IDirectSound using the primary sound device

DirectSoundCreate8(NULL,&m_pDS,NULL);
IDirectSound8_SetCooperativeLevel(m_pDS,NULL, DSSCL_NORMAL);
ZeroMemory( &dsbd, sizeof(DSBUFFERDESC) );
dsbd.dwSize = sizeof(DSBUFFERDESC);
dsbd.dwFlags = DSBCAPS_PRIMARYBUFFER;
dsbd.dwBufferBytes = 0;
dsbd.lpwfxFormat = NULL;
IDirectSound8_CreateSoundBuffer(m_pDS, &dsbd, &pDSBPrimary, NULL );


But even if it compile I didn't test my gauge in fs2002
I suspect this will not run without trouble.. the doc is unclear and few ressource are on net about this.

I try to follow the playsound example (mfc c++) in dx8 sample
but for example DSSCL_EXCLUSIVE doesn't seem to fit
and with DSSCL_NORMAL you cannot set the primary buffer.

Again any help appreciated if anyone got experience with this.
I know well d3d but dsound was always misterious for me (I use Fmod usually)

Dan


[edited by - dansteph on April 17, 2002 5:09:37 PM]

Share this post


Link to post
Share on other sites
It looks like you get C version of the interfaces. Can you use C++ version of other DX interfaces? Are you sure you are compiling a C++ program? Most likely you have strange project settings or global defines. Try removing all dsound-related code from your project and copy some from an app that you know compiles

m_pDS->SetCooperativeLevel( hWnd, dwCoopLevel );

[edited by - IndirectX on April 17, 2002 8:34:58 PM]

Share this post


Link to post
Share on other sites
btw, ake sure you use
extern "C" (with quotes)
before all exported function names if compiling a dll with a c++ compiler so it does not mangle the names.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!