请高手指点迷津.
feng 2000-07-24 04:10:00 下面程序运行到标号4的时候报错
#include "windows.h"
#include "dsound.h"
typedef HRESULT (*CreateDSound)(LPCGUID ,LPDIRECTSOUND * ,LPUNKNOWN );
HMODULE haspi = NULL;
CreateDSound DSoundCreate = NULL;
HRESULT hr;
LPDIRECTSOUND m_ps_ds;
1. if( hr = CoInitialize(NULL) )
printf("error\n");
2. haspi = LoadLibrary("dsound.dll");
if(haspi == NULL)
printf("error\n");
3. DSoundCreate = (CreateDSound)GetProcAddress(haspi, "DirectSoundCreate");
//extern HRESULT WINAPI DirectSoundCreate(LPCGUID, LPDIRECTSOUND *, LPUNKNOWN);
4. hr = DSoundCreate( NULL, &m_ps_ds, NULL );
if( FAILED( hr ) )
printf("error\n");
错误信息如下
The value of ESP was not properly saved across a function call.
This is usually a result of calling a function declared with one
calling convention with a function pointer declared with a different
calling convention
请高手指点迷津.