本文整理汇总了C++中LPDIRECTINPUTDEVICE8::EnumEffectsInFile方法的典型用法代码示例。如果您正苦于以下问题:C++ LPDIRECTINPUTDEVICE8::EnumEffectsInFile方法的具体用法?C++ LPDIRECTINPUTDEVICE8::EnumEffectsInFile怎么用?C++ LPDIRECTINPUTDEVICE8::EnumEffectsInFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LPDIRECTINPUTDEVICE8
的用法示例。
在下文中一共展示了LPDIRECTINPUTDEVICE8::EnumEffectsInFile方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnReadFile
//-----------------------------------------------------------------------------
// Name: OnReadFile()
// Desc: Reads a file contain a collection of DirectInput force feedback
// effects. It creates each of effect read in and stores it
// in the linked list, g_EffectsList.
//-----------------------------------------------------------------------------
HRESULT OnReadFile( HWND hDlg )
{
HRESULT hr;
static TCHAR strFileName[MAX_PATH] = TEXT("");
static TCHAR strPath[MAX_PATH] = TEXT("");
// Setup the OPENFILENAME structure
OPENFILENAME ofn = { sizeof(OPENFILENAME), hDlg, NULL,
TEXT("FEdit Files\0*.ffe\0All Files\0*.*\0\0"), NULL,
0, 1, strFileName, MAX_PATH, NULL, 0, strPath,
TEXT("Open FEdit File"),
OFN_FILEMUSTEXIST|OFN_HIDEREADONLY, 0, 0,
TEXT(".ffe"), 0, NULL, NULL };
// Get the default media path (something like C:\DXSDK\SAMPLES\MULTIMEDIA\DINPUT\MEDIA)
if( '\0' == strPath[0] )
_tcscpy( strPath, DXUtil_GetDXSDKMediaPath() );
// Display the OpenFileName dialog. Then, try to load the specified file
if( FALSE == GetOpenFileName( &ofn ) )
return S_OK;
EmptyEffectList();
// Enumerate the effects in the file selected, and create them in the callback
if( FAILED( hr = g_pFFDevice->EnumEffectsInFile( strFileName,
EnumAndCreateEffectsCallback,
NULL, DIFEF_MODIFYIFNEEDED ) ) )
return hr;
// Remember the path for next time
_tcscpy( strPath, strFileName );
TCHAR* strLastSlash = _tcsrchr( strPath, '\\' );
strLastSlash[0] = '\0';
// If list of effects is empty, then we haven't been able to create any effects
if( g_EffectsList.pNext == &g_EffectsList )
{
// Pop up a box informing the user
MessageBox( hDlg, _T("Unable to create any effects."),
_T("ReadFFE"), MB_ICONEXCLAMATION | MB_OK );
EnableWindow( GetDlgItem( hDlg, IDC_PLAY_EFFECTS ), FALSE );
}
else
{
// We have effects so enable the 'play effects' button
EnableWindow( GetDlgItem( hDlg, IDC_PLAY_EFFECTS ), TRUE );
}
return S_OK;
}
示例2: LoadEffectFile
//-----------------------------------------------------------------------------
// Purpose:
// Input : device -
// &map -
// Output : static void
//-----------------------------------------------------------------------------
static void LoadEffectFile( LPDIRECTINPUTDEVICE8 device, EffectMap_t &map )
{
LoadEffectContext_t context;
context.device = device;
context.map = ↦
// Pull out of .gcf if needed
filesystem->GetLocalCopy( map.effectfile );
char fullpath[ 512 ];
filesystem->GetLocalPath( map.effectfile, fullpath, sizeof( fullpath ) );
HRESULT hr = device->EnumEffectsInFile
( fullpath,
EnumEffectsInFileProc,
(LPVOID)&context,
DIFEF_MODIFYIFNEEDED );
if ( FAILED( hr ) )
{
Msg( "EnumEffectsInFile failed for %s\n", map.effectfile );
}
}
示例3: EnumEffectsInFile
HRESULT _stdcall EnumEffectsInFile(LPCWSTR a,LPDIENUMEFFECTSINFILECALLBACK b,LPVOID c,DWORD d) {
return RealDevice->EnumEffectsInFile(a,b,c,d);
}