CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2001
    Posts
    14

    VB Problem finding DLL

    Hi,

    I have the following problem...

    I have written a VB program that uses a self written DLL.
    When I launch the application from my own computer I have no problem.
    But when I launch the same application from the same network drive but from a different computer
    I get the error 'File not Found enmvbapi.dll'.

    This is very strange because the only place the DLL is located is the directory from the EXE.
    The DLL has not been registered on my system. I searched my registry for any reference regarding my DLL but I did not find it.

    My VB declaration for my DLL is as follows :


    Declare Function VBENMAttach Lib "enmvbapi.dll" (byval InUserId as string, byval InPassword as string, byval FuncId as string) as Integer




    Am I missing somehting here... Should I doe additional things to make a DLL known to a computer.

    Tom



  2. #2
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: VB Problem finding DLL

    You can't call a VB dll like that. If it isn't a VB dll you're calling, you must register the dll. You can do this by using regsvr32.exe, which is located in the system directory.


    Tom Cannaerts
    [email protected]

    Programming today is a race between software engineers striving to build bigger and better idot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

  3. #3
    Join Date
    Dec 1999
    Location
    Dublin, Ireland
    Posts
    1,173

    Re: VB Problem finding DLL

    The search pattern for DLLs goes:
    $WINDIR, $WINDIR\System32, $Path, current directory.

    So either add the dll to windows directory, system 32 directory or the path, or make sure that the "Start in" part of your application shortcut is the same directory as the DLL is in.

    HTH,
    D.

    -------------------------------------------------
    Ex. Datis: Duncan Jones
    Merrion Computing Ltd
    http://www.merrioncomputing.com
    '--8<-----------------------------------------
    NEW -The printer usage monitoring application
    '--8<------------------------------------------

  4. #4
    Join Date
    Jun 2001
    Posts
    14

    Re: VB Problem finding DLL

    Duncan,

    I already tried to put the DLL in the SYSTEM32 from my WINNT system. I took into account the search order of the DLL but it still does not work (event when I put it in the SYSTEM32 directory)...

    Tom



  5. #5
    Join Date
    Apr 2000
    Posts
    737

    Re: VB Problem finding DLL

    like cakkie say, if your dll is ActiveX DLL, you need to register it. if it is only a normal win32 DLL, chances are the DLL that you are calling depends on other DLL which doesn't exist, in the case, the Depends.exe utility (come with visual studio 6) is a good utility which can show you if your DLL dependency is OK or not. just use depends on your self-written DLL.


    HTH

    cksiow
    http://vblib.virtualave.net - share our codes

  6. #6
    Join Date
    Jun 2001
    Posts
    14

    Re: VB Problem finding DLL

    Duncan,

    problem solved....
    I tried registering the DLL with REGSVR32.EXE and I got a errorcode from a subDLL delivered by the vendor.. Apparently the PC I tried running my program on was not at the right fix level and had differences in DLL's...
    The LoadLibrary fails and VB acts by putting 'File not Found' as errorcode...

    Tricky business....

    Thx anyway !!!
    Tom



  7. #7
    Join Date
    Jun 2001
    Posts
    14

    Re: VB Problem finding DLL

    Tom,

    problem solved....
    I tried registering the DLL with REGSVR32.EXE and I got a errorcode from a subDLL delivered by the vendor.. Apparently the PC I tried running my program on was not at the right fix level and had differences in DLL's...
    The LoadLibrary fails and VB acts by putting 'File not Found' as errorcode...

    Tricky business....

    Thx anyway !!!
    Tom


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured