Okay here is a C++ Plugin test but this time I've added some structs to test so you can see if you can get strings transferring to and from the plugin. Should be pretty straight forward.
typedef struct
{
char Name[256];
char Author[256];
char Version[256];
} PluginInfo;
typedef struct
{
char Name[256];
char Artist[256];
char Album[256];
} SongInfo;
// JukePlugin.cpp : Defines the entry point for the DLL application.
//
#include "stdafx.h"
#include "JukePlugin.h"
// standard windows headers
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdio.h>
#define PLUGIN_NAME "Test Plugin"
#define PLUGIN_AUTHOR "Ben Baker"
#define PLUGIN_VERSION "1.0"
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
JUKEPLUGIN_API int __stdcall Juke_GetPluginInfo(PluginInfo *pluginInfo)
{
strncpy(pluginInfo->Name, PLUGIN_NAME, 256);
strncpy(pluginInfo->Author, PLUGIN_AUTHOR, 256);
strncpy(pluginInfo->Version, PLUGIN_VERSION, 256);
return 1;
}
JUKEPLUGIN_API int __stdcall Juke_SongStart(SongInfo *songInfo)
{
char buf[512];
sprintf(buf, "Song has started, Name: %s, Album: %s, Artist: %s", songInfo->Name,
songInfo->Album, songInfo->Artist);
MessageBox(NULL, buf, "Message", MB_OK);
return 1;
}
JUKEPLUGIN_API int __stdcall Juke_SongEnd(SongInfo *songInfo)
{
char buf[512];
sprintf(buf, "Song has ended, Name: %s, Album: %s, Artist: %s", songInfo->Name,
songInfo->Album, songInfo->Artist);
MessageBox(NULL, buf, "Message", MB_OK);
return 1;
}