|
|
Note to Chris Cason / other windows developers - Nathan & Jetlag
Don't know if anyone else knows about this & sorry for wasting your time
if you do (I know it is precious at the moment-3.5) but
A while back people were discussing MegaPOV & why the editor DLL could
not be found when the MegaPOV exe was not in the <povwin>\bin dir. the
solution suggested at the time was to put your exes in the \bin dir
where the dlls are but...
According to changes.txt the load logic was changed so that the editor
dll was looked for first in the same dir as the exe, then the \bin dir.
IMHO this is a great thing & it would be if it worked.
When implementing this it seems U didn't take into account a bug (IMHO)
in LoadLibrary.
I found that LoadLibrary always fails if you specify a path for a DLL -
use the below code to allow loading from different directories.
//#define LOAD_WITH_ALTERED_SEARCH_PATH 8 //<-----------from the windows
headers
LoadLibraryEx( path , 0, LOAD_WITH_ALTERED_SEARCH_PATH);
in LoadEditorDLL in pvedit.c when loading the long dllname use the
above
So from the POVWin 3.1g src in pvedit.c
if ((hLibPovEdit = LoadLibrary (shortdllname)) == NULL)
{
if ((hLibPovEdit = LoadLibrary (dllname)) ==
NULL)<<<<<<<-----------Here
{
if (debugFile)
fprintf (debugFile, "Could not load Editor DLL, error code is
%08lx\n", GetLastError ()) ;
sprintf (str, "Editor DLL initialisation failed [LoadLibrary
failed, code is %08lx]", GetLastError ()) ;
PovMessageBox (str, "POV-Ray Editor error") ;
PovMessageBox ("See the 'Built-In Editors' section in the help
file", "Important!") ;
return (false) ;
becomes
if ((hLibPovEdit = LoadLibrary (shortdllname)) == NULL) //<<---- Don't
use it here or loading will fail
{
if ((hLibPovEdit = LoadLibraryEx (dllname, 0,
LOAD_WITH_ALTERED_SEARCH_PATH)) == NULL)
//^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----------Here
{
if (debugFile)
fprintf (debugFile, "Could not load Editor DLL, error code is
%08lx\n", GetLastError ()) ;
sprintf (str, "Editor DLL initialisation failed [LoadLibrary
failed, code is %08lx]", GetLastError ()) ;
PovMessageBox (str, "POV-Ray Editor error") ;
PovMessageBox ("See the 'Built-In Editors' section in the help
file", "Important!") ;
return (false) ;
Seey'll
Pabs
Post a reply to this message
|
|
|
|
Chris C wrote:
> I almost missed this report
Glad U found it
> - it really belongs in povray.bugreports,
I'll remember that if I find any other windows specific bugs
It really isn't a bug in POVWin, but in LoadLibrary - IMHO
> not here (I don't read this group much).
???????? aren't you the windows developer
> I'll put this into 3.5.
Good
> Thanks for the info,
No worries.
--
Bye
Pabs
Post a reply to this message
|
|