代码如下:HRESULT InitNotifications()
{
ghNotificationEvent = CreateEvent( NULL, FALSE, FALSE, NULL );
HRESULT hr = gpDSBuffer8->QueryInterface( IID_IDirectSoundNotify,( VOID** )&pDSNotify8 );
if( FAILED( hr ) ) return hr; for( INT i = 0; i < NUM_PLAY_NOTIFICATIONS; i++ )
{
aPosNotify[i].dwOffset = ( gdwNotifySize * i ) + gdwNotifySize - 1;
aPosNotify[i].hEventNotify = ghNotificationEvent;
} hr = pDSNotify8->SetNotificationPositions( NUM_PLAY_NOTIFICATIONS,aPosNotify );
if( FAILED( hr ) ) return hr; return S_OK;
}单步调式发现到这里
hr = pDSNotify8->SetNotificationPositions( 16,aPosNotify );
返回了E_INVALIDARG。
DSBPOSITIONNOTIFY aPosNotify[16];
函数参数都是对的啊。到底什么地方出了问题?
如果说是offset 我改成 1 2 3 4 5 6 7 8 。。都不行。
{
ghNotificationEvent = CreateEvent( NULL, FALSE, FALSE, NULL );
HRESULT hr = gpDSBuffer8->QueryInterface( IID_IDirectSoundNotify,( VOID** )&pDSNotify8 );
if( FAILED( hr ) ) return hr; for( INT i = 0; i < NUM_PLAY_NOTIFICATIONS; i++ )
{
aPosNotify[i].dwOffset = ( gdwNotifySize * i ) + gdwNotifySize - 1;
aPosNotify[i].hEventNotify = ghNotificationEvent;
} hr = pDSNotify8->SetNotificationPositions( NUM_PLAY_NOTIFICATIONS,aPosNotify );
if( FAILED( hr ) ) return hr; return S_OK;
}单步调式发现到这里
hr = pDSNotify8->SetNotificationPositions( 16,aPosNotify );
返回了E_INVALIDARG。
DSBPOSITIONNOTIFY aPosNotify[16];
函数参数都是对的啊。到底什么地方出了问题?
如果说是offset 我改成 1 2 3 4 5 6 7 8 。。都不行。
解决方案 »
- IHTMLElementCollection::item到底能否返回一个Collection?
- 我想把 工具条 去掉,该怎么才能正常建立程序框架?
- 如何才能在自己的CEditView中显示行号?就像.NET的编辑器那样。
- 想当大版主,有人支持吗?
- 有VC的SPY的源代码吗?
- 200分求显示jpg(文件型)图片方法!!!
- 请教:如何在应用程序中使用chm的帮助文件
- 帮忙看看程序,不知道错在那?谢谢
- 高手请进!
- VC中ActiveX控件的属性无字符型,如何将BSTR转化为Char*,我已转化了英文,中文怎么办呢?
- 请教一个new和delete的问题
- 如何在 mfc创建的 ACtivex控件中, 实现接口的继承 ?? ........
呵呵 解决啦。是因为dwOffset 设置不对。
但是很奇怪,一开始我设置成1 2 3 4 这样小的数值都不对。
现在又可以了。
但是现在新问题来了。又只好开贴。 还望大侠能够给小弟解惑。
这回是socket的问题