POV-Ray : Newsgroups : povray.windows : "DLL not found" error bugfix for Mr C. Cason Server Time
5 Jul 2024 04:55:11 EDT (-0400)
  "DLL not found" error bugfix for Mr C. Cason (Message 1 to 3 of 3)  
From: Pabs
Subject: "DLL not found" error bugfix for Mr C. Cason
Date: 18 Sep 2000 20:16:36
Message: <39C6B0A7.D9F2A714@hotmail.com>
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

From: Chris C
Subject: Re: "DLL not found" error bugfix for Mr C. Cason
Date: 22 Sep 2000 09:11:11
Message: <39cb5a6f@news.povray.org>
I almost missed this report - it really belongs in povray.bugreports,
not here (I don't read this group much). I'll put this into 3.5.

Thanks for the info,

-- Chris C


Post a reply to this message

From: Pabs
Subject: Re: "DLL not found" error bugfix for Mr C. Cason
Date: 28 Sep 2000 00:42:34
Message: <39D2CBF0.FA306659@hotmail.com>
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

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