1. Win32 not finding a DLL after Binding

After binding a Euphoria program which uses Win32, and moving it along with the C language DLL which I use, to another computer, the Euphoria program (exe) did not find the DLL. I keep the DLL in the same directory/folder as the exe. Is there anything in the computer environment which could cause this problem?

0.70.4 is the win32 library version

A. Katz

new topic     » topic index » view message » categorize

2. Re: Win32 not finding a DLL after Binding

dll are searched in the following order:
1) main program directory
2) %windir%\system32

If the DLL's are in same directory as main program it should find them but it may depend on user access rights. Check security tab in the directory properties dialog to see if the user as sufficient access rights. This is true only for windows 2000/xp/vista member of a domain. For personnal edition or professional edition not member of an active directory domain there is no security tab visible. In that case you should open cmd.exe and use cacls.exe to display and modify access control list for the directory.

to display ACL for directory:

cacls app_dir
to give "user_name" full control to "app_dir" type in cmd.exe

cacls app_dir /E /T /G:user_name F

jacques

penpal0andrew said...

After binding a Euphoria program which uses Win32, and moving it along with the C language DLL which I use, to another computer, the Euphoria program (exe) did not find the DLL. I keep the DLL in the same directory/folder as the exe. Is there anything in the computer environment which could cause this problem?

0.70.4 is the win32 library version

A. Katz

new topic     » goto parent     » topic index » view message » categorize

3. Re: Win32 not finding a DLL after Binding

This is not the problem. No matter where I place the files on the destination computer, the DLL is not found. And no matter where I place the files on the development computer, the DLL is found. Thinking this may be a DLL problem, I went to the destination computer and re-created the DLL from source files. The result was the same. I looked into Euphoria, and this is base Euphoria, and not win32. The code in Euphoria is:

draw_dll = open_dll ("Draw_MGS.dll") -- xxxx 
if draw_dll = 0 then 
    abortErr(  "DLL file not found" ) 
end if 

This issue needs to be resolved. I suspect it is related to the binding process. Another possibility is that the destination computer once had Euphoria on it and it was removed incorrectly?

jacquesd said...

dll are searched in the following order:
1) main program directory
2) %windir%\system32

If the DLL's are in same directory as main program it should find them but it may depend on user access rights. Check security tab in the directory properties dialog to see if the user as sufficient access rights. This is true only for windows 2000/xp/vista member of a domain. For personnal edition or professional edition not member of an active directory domain there is no security tab visible. In that case you should open cmd.exe and use cacls.exe to display and modify access control list for the directory.

to display ACL for directory:

cacls app_dir
to give "user_name" full control to "app_dir" type in cmd.exe

cacls app_dir /E /T /G:user_name F

jacques

penpal0andrew said...

After binding a Euphoria program which uses Win32, and moving it along with the C language DLL which I use, to another computer, the Euphoria program (exe) did not find the DLL. I keep the DLL in the same directory/folder as the exe. Is there anything in the computer environment which could cause this problem?

0.70.4 is the win32 library version

A. Katz

new topic     » goto parent     » topic index » view message » categorize

4. Re: Win32 not finding a DLL after Binding

This may be a Dev C issue. Euphoria being bound or not does not matter. There may be something which causes a DLL to not be found which does not mean it is not found. It means it is not a valid DLL?

new topic     » goto parent     » topic index » view message » categorize

5. Re: Win32 not finding a DLL after Binding

penpal0andrew said...

This is not the problem. No matter where I place the files on the destination computer, the DLL is not found. And no matter where I place the files on the development computer, the DLL is found. Thinking this may be a DLL problem, I went to the destination computer and re-created the DLL from source files. The result was the same. I looked into Euphoria, and this is base Euphoria, and not win32. The code in Euphoria is:

draw_dll = open_dll ("Draw_MGS.dll") -- xxxx 
if draw_dll = 0 then 
    abortErr(  "DLL file not found" ) 
end if 

Here are a few ideas:

  • Have you tried using absolute paths?
  • Do you have the dll installed to Windows\System32 on the dev machine, but not on the production machine?
  • Can you open the file for reading?
    draw_dll = open( "Draw_MGS.dll", "r" ) 

Matt

new topic     » goto parent     » topic index » view message » categorize

6. Re: Win32 not finding a DLL after Binding

mattlewis said...
penpal0andrew said...

This is not the problem. No matter where I place the files on the destination computer, the DLL is not found. And no matter where I place the files on the development computer, the DLL is found. Thinking this may be a DLL problem, I went to the destination computer and re-created the DLL from source files. The result was the same. I looked into Euphoria, and this is base Euphoria, and not win32. The code in Euphoria is:

draw_dll = open_dll ("Draw_MGS.dll") -- xxxx 
if draw_dll = 0 then 
    abortErr(  "DLL file not found" ) 
end if 

Here are a few ideas:

  • Have you tried using absolute paths?
  • Do you have the dll installed to Windows\System32 on the dev machine, but not on the production machine?
  • Can you open the file for reading?
    draw_dll = open( "Draw_MGS.dll", "r" ) 

Matt

I found the problem. There are nested dependencies in the DLL I developed. And it happened to find these libraries from another application I installed, which does not exist in the other computer. The tool to use to find DLL dependencies is http://www.dependencywalker.com/ . This is not a Euphoria issue thank goodness.

new topic     » goto parent     » topic index » view message » categorize

7. Re: Win32 not finding a DLL after Binding

penpal0andrew said...

I found the problem. There are nested dependencies in the DLL I developed. And it happened to find these libraries from another application I installed, which does not exist in the other computer. The tool to use to find DLL dependencies is http://www.dependencywalker.com/ . This is not a Euphoria issue thank goodness.

I love Dependency Walker. I'd be lost without it sometimes. grin

-Greg

new topic     » goto parent     » topic index » view message » categorize

8. Re: Win32 not finding a DLL after Binding

penpal0andrew said...

I found the problem. There are nested dependencies in the DLL I developed. And it happened to find these libraries from another application I installed, which does not exist in the other computer. The tool to use to find DLL dependencies is http://www.dependencywalker.com/ . This is not a Euphoria issue thank goodness.

It always seems so obvious in hindsight. getlost Depdencywalker is a great tool.

Matt

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu