我刚刚为Winamp制作了这个非常简单的.dll插件。它在我的电脑上运行的很好,但是我为一个朋友做了这个请求。这是我第一次使用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;
}发布于 2013-12-19 20:22:35
您缺少Visual 2013运行时。正确的安装方法是通过Visual 2013可再发行版。
http://www.microsoft.com/en-us/download/details.aspx?id=40784
发布于 2013-12-19 20:15:49
MSVCR120.DLL丢失了,它可能不是让它工作的“正确”方法,但我只是把我的复制到他的插件dir.我仍然认为可以通过一些出口旗子什么的来解决这个问题,但我对此很懒得。
https://stackoverflow.com/questions/20690036
复制相似问题