谁能告诉我这有什么问题吗?

标签 c mfc bass

我是 Bass 的初学者(现在正在从事 MFC 项目),我正在尝试解决这个问题。

我发现应该从 BASS_Init 函数开始,但我找到了两个示例,一个有 4 个参数,另一个有 6 个参数。

当我尝试使用该函数时,它只提供一个没有重载的 5 参数版本,当我尝试使用它时,我的应用程序崩溃了。有没有在 MFC 上使用 BASS 的好例子可供我学习?或者在哪里可以找到 API 的文档?

该行是:

BASS_Init(-1,44100,0,this->m_hWnd,NULL);

我已经尝试过:

BASS_Init(-1,44100,0,GetSafeHwnd(),NULL);

但还是崩溃

最佳答案

BASS_Init() 函数采用 5 参数:

BOOL BASS_Init(
    int device, // The device to use... -1 = default device, 0 = no sound, 1 = first real output device
    DWORD freq, // Output sample rate
    DWORD flags, // A combination of flags
    HWND win, // The application's main window... 0 = the current foreground window (use this for console applications)
    GUID *clsid // Class identifier of the object to create, that will be used to initialize DirectSound... NULL = use default
);

示例:

int device = -1; // Default device
int freq = 44100; // Sample rate

BASS_Init(device, freq, 0, 0, NULL); // Init BASS

API 文档: http://www.un4seen.com/doc/#bass/BASS_Init.html

关于谁能告诉我这有什么问题吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3267678/

相关文章:

c++ - 警告 C6273 : Non-integer passed as _Param_(2) when an integer is required

c++ - #include <WinUsb.h> 在 MFC 应用程序中产生编译器错误

c++ - 如何优化绘图例程以在 Windows CE 中实现最大刷新率?

visual-studio - 低音库未链接,所有其他工作完美

c# - 获取mp3文件长度

c - 共享内存在 C 中不与进程共享

c - malloc 上已释放对象的校验和不正确

c - 使用基本结构从 void* 中提取值

c - Bug 当我尝试比较时

c# - BASS WASAPI BPMCounter