|
![](/i/fill.gif) |
>Anyone have a very basic GUI ext example that was written with VC 5 or 6
>that they would like to share with me? I'm having trouble with POV
>loading my extension.
>
>I get the "Could not get Init address for GUI Extension DLL" error.
>And yes, I have __declspec(dllexport) in there.
>
>Thanks
>
>ryan
This was posted a few years ago without a follow-up answer that would have
saved me some time - so here is the answer now for anyone else needing it.
I had to modify the sample code for GUI extensions to get it to work when
compiled with VC++ 6.0 partly because the "__export" declaration is no
longer supported in 6.0, and because of the name decorations that the
compiler puts on functions.
When POV-Ray loads a GUI extension, it accesses the DLL and looks for a
function called "PovGuiExtensionGetPointers". In GuiDemo.c you will want to
modify the declaration of that function to look something like this:
__declspec(dllexport) DWORD __cdecl PovGuiExtensionGetPointers (int
RecSize, GuiPointerBlock *PointerBlock)
... using WINAPI like the original GuiDemo.c unfortunately can cause the
name to be decorated in the linker, meaning that when POV-Ray looks for
PovGuiExtensionGetPointers it cannot find it, because the name gets munged
to _PovGuiExtensionGetPointers@8 or something similar. There are other ways
of accomplishing the same result but this worked for me.
JP
Post a reply to this message
|
![](/i/fill.gif) |