It is currently August 8th, 2022, 10:58 pm

Dev Question; Plugin "...doesn't export Update or GetString"

General topics related to Rainmeter.
Risible
Posts: 3
Joined: June 6th, 2010, 11:13 pm
Location: North Carolina

Dev Question; Plugin "...doesn't export Update or GetString"

Post by Risible »

In my free time this Summer I've been working on a plugin for Rainmeter while I look for a job; I'm at the point where I want to test it, and see what kind of information its putting out (if any), but I get the following error message:

"Rainmeter plugin c:\$pathname$\plugin.dll doesn't export Update or GetString function!"

I know what the literal error message means, but not how to fix it. I've coded the update function, the code builds correctly, but I'm not sure what is missing that causes the error.

Is there a general cause for this error? Where might it occur?
User avatar
JamesAC
Developer
Posts: 318
Joined: July 14th, 2009, 5:57 pm

Re: Dev Question; Plugin "...doesn't export Update or GetString"

Post by JamesAC »

I think the only cause would be if the functions are not exported correctly using dllexport.

All of the current plugins have a section like this:

Code: Select all

extern "C"
{
__declspec( dllexport ) UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id);
__declspec( dllexport ) void Finalize(HMODULE instance, UINT id);
__declspec( dllexport ) double Update2(UINT id);
__declspec( dllexport ) LPCTSTR GetString(UINT id, UINT flags);
__declspec( dllexport ) UINT GetPluginVersion();
__declspec( dllexport ) LPCTSTR GetPluginAuthor();
}
I could be wrong but that is where I would look first.
+++ Divide By Cucumber Error. Please Reinstall Universe And Reboot +++
Quis custodiet ipsos custodes?
Risible
Posts: 3
Joined: June 6th, 2010, 11:13 pm
Location: North Carolina

Re: Dev Question; Plugin "...doesn't export Update or GetString"

Post by Risible »

JamesAC wrote:I think the only cause would be if the functions are not exported correctly using dllexport.

All of the current plugins have a section like this:

Code: Select all

extern "C"
{
__declspec( dllexport ) UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id);
__declspec( dllexport ) void Finalize(HMODULE instance, UINT id);
__declspec( dllexport ) double Update2(UINT id);
__declspec( dllexport ) LPCTSTR GetString(UINT id, UINT flags);
__declspec( dllexport ) UINT GetPluginVersion();
__declspec( dllexport ) LPCTSTR GetPluginAuthor();
}
I could be wrong but that is where I would look first.
You're not wrong at all. I left out the extern "C" {} statement so it wasn't being compiled correctly. I don't think I understood why that particular part would have to be compiled in "C" so I left it out, and then forgot to put it back in, haha. Thanks very much.