DLL won't load VB.NET

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • seraieis
    New Member
    • Apr 2008
    • 60

    DLL won't load VB.NET

    Good afternoon experts!

    I'm having trouble getting a dll to properly load. It loads on my machine, and even though the users who will be using the library have it on their machine, the program will not recognize it.

    I'm writing an automation program that interacts with a green screen application. It uses the atmapi32.dll library. The first time I tried to run it on someone's computer, i received the following error:
    Code:
    System.DllNotFoundException: Unable to load DLL 'atmapi32.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
    Thanks to Plater, and his suggestion in another thread to use Process Explorer, I learned the path of the DLL it was trying to use. Thinking myself extremely clever, I hard coded the library directory, to point to a copy of the library in the application's folder but I got this error instread:
    Code:
    System.DllNotFoundException: Unable to load DLL 'c:\program files\sls\workbook1\atmapi32.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
    I've been down a similar path before, with trying to get the same program to recognize a library, however the that case, the library didn't exist on the users' machines. In this case, the library exists, but the program will not find it, even when I hard code.

    Does anyone know how I can fix this? My only other thought would be to find a way to package the library in the install file (which I don't know how to do either).

    Thank you in advance!
    Last edited by seraieis; Nov 10 '08, 09:04 PM. Reason: change title to show language
  • seraieis
    New Member
    • Apr 2008
    • 60

    #2
    As a follow up, I've tried using gcutil on the users computer, but that doesn't seem to help either.

    Comment

    • Plater
      Recognized Expert Expert
      • Apr 2007
      • 7872

      #3
      This is a bit of a head scratcher, I think gcutil only applies to .NET(managed) DLLs, if the DLL is a COM dll, it gets registered differently I think.
      Not sure why it would not allow you to use the dll on other systems.
      Maybe the error message is a red herring and its really a security/permissions issue on the system?

      Comment

      • seraieis
        New Member
        • Apr 2008
        • 60

        #4
        I tried going into the application properties and running the analyzer for the security, and it made the application Full Trust. But I got the same error as I did before. Is there a way to see exactly what the function within the DLL is trying to do, so I can see where the exception is being generated from?

        Comment

        • seraieis
          New Member
          • Apr 2008
          • 60

          #5
          I've also tried to use Dependency walker to see if I'm missing a library. It says that MPR.dll has "At least one module has an unresolved import due to a missing export function in a delay-load dependent module." The function missing the export is WNetRestoreConn ectionA. I get the same error on my machine (where the program does work) as well as the users, so I don't think that's the issue.

          I'm don't know if this will help narrow it down any...

          Comment

          • seraieis
            New Member
            • Apr 2008
            • 60

            #6
            Code:
            Environment.SetEnvironmentVariable("PATH", Environment.GetEnvironmentVariable("PATH") & ";C:\Program Files\IBM\EHLLAPI")
            Figured it out! The PATH variable was missing the directory where the atmapi32 was located.

            Thank you all for your help!

            Comment

            Working...