POV-Ray : Newsgroups : povray.programming : re: VC++ 6.0 & GUIext : re: VC++ 6.0 & GUIext Server Time
28 Jul 2024 10:27:36 EDT (-0400)
  re: VC++ 6.0 & GUIext  
From: John Pallett
Date: 30 May 2002 20:02:57
Message: <3cf6bdb1$1@news.povray.org>
>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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.