I read all the documentation, and i made my plugin using the following code:
Code: Select all
/* Windows headers */
#include "windows.h"
/* C headers */
#include <stdlib.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#define MODULE_STRING "hello"
#define DOMAIN "hello"
#define _(str) dgettext(DOMAIN, str)
#define N_(str) (str)
#define strdup _strdup
//#include <inttypes.h>
/* VLC core API headers */
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_interface.h>
#pragma comment(lib, "libvlccore.lib")
/* Forward declarations */
static int Open(vlc_object_t *);
static void Close(vlc_object_t *);
/* Module descriptor */
vlc_module_begin()
set_text_domain(DOMAIN)
set_shortname(N_("hello"))
set_description(N_("Hello interface"))
set_category(CAT_INTERFACE)
set_capability("interface", 10000)
set_callbacks(Open, Close)
add_string("hello-who", "world", "Target", "Whom to say hello to.", false)
vlc_module_end()
/* Internal state for an instance of the module */
struct intf_sys_t
{
char *who;
};
/**
* Starts our example interface.
*/
static int Open(vlc_object_t *obj)
{
MessageBox(NULL,"--please stay polite-- Open Called!","Success",NULL); //This one is never called.... :(
intf_thread_t *intf = (intf_thread_t *)obj;
/* Allocate internal state */
intf_sys_t *sys = (intf_sys_t*) malloc(sizeof (*sys));
if (unlikely(sys == NULL))
return VLC_ENOMEM;
intf->p_sys = sys;
/* Read settings */
char *who = var_InheritString(intf, "hello-who");
if (who == NULL)
{
msg_Err(intf, "Nobody to say hello to!");
goto error;
}
sys->who = who;
msg_Info(intf, "Hello %s!", who);
return VLC_SUCCESS;
error:
free(sys);
return VLC_EGENERIC;
}
/**
* Stops the interface.
*/
static void Close(vlc_object_t *obj)
{
intf_thread_t *intf = (intf_thread_t *)obj;
intf_sys_t *sys = intf->p_sys;
msg_Info(intf, "Good bye %s!");
/* Free internal state */
free(sys->who);
free(sys);
}
BOOL __stdcall DllMain(HANDLE hDllHandle, DWORD dwReason, LPVOID lpReserved)
{
(void)hDllHandle,dwReason,lpReserved;
MessageBox(NULL,"My plugin Loaded!","Success!",NULL); //Pops up as soon as i start vlc.
return true;
}
I know that vlc finds my dll, because when i start him dllmain executes and pops up the MessageBox that it is in the code.
The problem is that it does not show in the Plugins list, neither in the list generated by using vlc --list. I tried also to clean the cache but nothing changed.
Can somebody help me? I've spent a lot of hours trying to figure that out, and i cannot find any other solution.
Thanks in advance.