Basics for a plugin with C++ DLL

Recommended Posts

I am currently starting the process of coding a small plugin for Overwolf that will let me display onscreen information that I gather from a DLL that I write in C++ (e.g. some information on the system's state, CPU, memory, etc... network status and more).

To get started I would like to simply modify the sample plugin so when it loads it retrieves an integer from my DLL, I think if I have that working I can manage the rest.

I tried to recreate the C# DLL in C++ but it fails miserably, the plugin simply does not even load.
First I had to create a main.cpp with the DllMain entry point, otherwise my compiler was screaming to death (perhaps that might be a problem), then I recreated the general structure of the DLL but it still does not work.
Here is what I attempted:

namespace overwolf {namespace samples {namespace plugins {classSamplePlugin{public:intSampleProperty=55;//int SampleProperty(); // Also tried to return it from a member function, didn't work};}}}

I tried without the namespaces too, no more luck.
In the JavaScript files that are supposed to load the plugin (main.js) the first lines are:

// create an instance of the pluginvar plugin =newOverwolfPlugin("OverwolfSamplePlugin",true);// initialize it
plugin.initialize(function(status){// ...

Nothing past plugin.initialize gets executed so I deduce that the plugin just fails to load (the dll is in the right directory with the right name, if I place the compiled C# DLL then it does work).

Is there the equivalent of the C# sample plugin DLL in C++ somewhere?Otherwise could anyone guide me on how to make my C++ DLL work and being able to call its functions from the HTML/JavaScript please?

I am sure that for someone used to the Overwolf's plugin system this will be easy, as there are several things that I don't quite get (I have only done standalone executable and DLL loaded "classically" from their entry point, never done a plugin before.