gpt4 book ai didi

c++ - 如何使 *.dll WinAmp 插件在 friend 的电脑上工作

转载 作者:太空宇宙 更新时间:2023-11-04 11:43:03 25 4
gpt4 key购买 nike

我刚刚为 Winamp 制作了这个非常简单的 .dll 插件。它在我的电脑上工作得很好,但我是为一个要求这个的 friend 做的。这是我第一次使用 Visual Studio 2013并用 C++ 制作 dll 文件...我的问题是我无法真正弄清楚为什么它在他的电脑上不起作用,我认为这是一个导出问题,但我不完全确定。

#include "stdafx.h"
#include <windows.h>
#include "gen_InfinitePlay.h"
#include "wa_ipc.h"
#include <stdio.h>
using namespace System;
using namespace System::Threading;


// these are callback functions/events which will be called by Winamp
int init(void);
void config(void);
void quit(void);


// this structure contains plugin information, version, name...
// GPPHDR_VER is the version of the winampGeneralPurposePlugin (GPP) structure
winampGeneralPurposePlugin plugin = {
GPPHDR_VER, // version of the plugin, defined in "gen_InfinitePlay.h"
PLUGIN_NAME, // name/title of the plugin, defined in "gen_InfinitePlay.h"
init, // function name which will be executed on init event
config, // function name which will be executed on config event
quit, // function name which will be executed on quit event
0, // handle to Winamp main window, loaded by winamp when this dll is loaded
0 // hinstance to this dll, loaded by winamp when this dll is loaded
};

void play(){
while (true){
if (SendMessage(plugin.hwndParent, WM_WA_IPC, 0, IPC_ISPLAYING) != 1)
SendMessage(plugin.hwndParent, WM_WA_IPC, 0, IPC_STARTPLAY);
Sleep(60000);
}
}
// event functions follow

int init() {


Thread^ t = gcnew Thread(gcnew ThreadStart(play));
t->Start();

return 0;
}

void config() {
//A basic messagebox that tells you the 'config' event has been triggered.
//You can change this later to do whatever you want (including nothing)
//MessageBox(plugin.hwndParent, L"Config event triggered for gen_InfinitePlay.", L"", MB_OK);
}

void quit() {
//A basic messagebox that tells you the 'quit' event has been triggered.
//If everything works you should see this message when you quit Winamp once your plugin has been installed.
//You can change this later to do whatever you want (including nothing)
//MessageBox(0, L"Quit event triggered for gen_InfinitePlay.", L"", MB_OK);
}


// This is an export function called by winamp which returns this plugin info.
// We wrap the code in 'extern "C"' to ensure the export isn't mangled if used in a CPP file.
extern "C" __declspec(dllexport) winampGeneralPurposePlugin * winampGetGeneralPurposePlugin() {
return &plugin;
}

最佳答案

您缺少 Visual Studio 2013 运行时。安装它的正确方法是通过 Visual Studio 2013 可再发行组件。

http://www.microsoft.com/en-us/download/details.aspx?id=40784

关于c++ - 如何使 *.dll WinAmp 插件在 friend 的电脑上工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20690036/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com