Can't add a dll in VB project

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • anjalimahey
    New Member
    • Oct 2006
    • 3

    Can't add a dll in VB project

    I am not able to add a dll in my VB6 project. It is located in project folder.
    I made a declaration in my form
    Private Declare Function FindPattern Lib "iEdit_Find.dll " (ByVal lpszPattern As String, ByVal lpszSource As String, ByVal nMatchCase As Long, ByVal nStart As Long, nlen As Long) As Long
    but when I run my project it gives the following runtime error:
    Run Time Error :53
    File not found : iEdit_Find.dll
    When I try to add it by Project>>Refere nces>>Browse>>s elect the dll it says:
    Cannot add reference to the specified file.
  • sashi
    Recognized Expert Top Contributor
    • Jun 2006
    • 1749

    #2
    Hi there,

    did you register your dll?

    kindly follow below method to register dll, take care my fren.. :)

    Code:
      regsvr32 somename.dll

    Comment

    • anjalimahey
      New Member
      • Oct 2006
      • 3

      #3
      Originally posted by sashi
      Hi there,

      did you register your dll?

      kindly follow below method to register dll, take care my fren.. :)

      Code:
        regsvr32 somename.dll
      thanks but i didnt work

      Comment

      • gasfusion
        New Member
        • Sep 2006
        • 59

        #4
        i'm having similar issues with one of the DLLs as well. When i try to register it errors out. My guess is there is something wrong with the actual DLL.

        Comment

        • sashi
          Recognized Expert Top Contributor
          • Jun 2006
          • 1749

          #5
          Hi there,

          Always remember, you can only successfully register .dll created with VB, if the particular .dll is not created with vb then just place the .dll in you system32 folder and try again. As sure you will be able to access it, good luck & take care my fren.. :)

          Comment

          • malcolmhourigan
            New Member
            • May 2007
            • 3

            #6
            Hi Sashi!

            Did you get the answer to your question? If yes, please guide me to do the same.

            I need to add a .dll file named DASHHARD.DLL to a vb project but can't. It is concerning DMX.

            An early soultion shall be highly appreciated.

            Thanks!

            Comment

            • malcolmhourigan
              New Member
              • May 2007
              • 3

              #7
              I just discovered that the .DLL file instead of the DASHARD.DLL is USBDMXVB.DLL. But I can't include it in my VB project. It cannot be registered due to some reason. I tried putting it in to the Windows\Syatem directory too.

              Not much luck today, I Guess...

              Malcolm Hourigan

              Comment

              • Killer42
                Recognized Expert Expert
                • Oct 2006
                • 8429

                #8
                It isn't mentioned anywhere in the thread, so has anyone tried specifying the full path to the DLL in the Declare statement?

                Comment

                • sandeepkavade
                  New Member
                  • Mar 2007
                  • 30

                  #9
                  Originally posted by anjalimahey
                  I am not able to add a dll in my VB6 project. It is located in project folder.
                  I made a declaration in my form
                  Private Declare Function FindPattern Lib "iEdit_Find.dll " (ByVal lpszPattern As String, ByVal lpszSource As String, ByVal nMatchCase As Long, ByVal nStart As Long, nlen As Long) As Long
                  but when I run my project it gives the following runtime error:
                  Run Time Error :53
                  File not found : iEdit_Find.dll
                  When I try to add it by Project>>Refere nces>>Browse>>s elect the dll it says:
                  Cannot add reference to the specified file.


                  you may try this. i was facing the similar problem, it has worked for me.


                  give Alias to the function name. it is required if the dll is C++ dll due to compilers name mangling mechanism.

                  Private Declare Function FindPattern Lib "iEdit_Find.dll " Alias "_FindPattern@2 0" (ByVal lpszPattern As String, ByVal lpszSource As String, ByVal nMatchCase As Long, ByVal nStart As Long, nlen As Long) As Long


                  if still it is not working give the full path of the dll instead of "iEdit_Find.dll "
                  it has to work.

                  Comment

                  • isotope11
                    New Member
                    • Mar 2007
                    • 10

                    #10
                    Open the dll and use c:/windows/system32/regsvr32.exe to open the dll
                    Hope that could help.

                    Comment

                    • malcolmhourigan
                      New Member
                      • May 2007
                      • 3

                      #11
                      Hi!
                      I think I need a small example proggie to explain huw to add a .dll and how to use it.

                      I need to know how I can program a DMX device.

                      Any help?

                      Comment

                      • thorpie
                        New Member
                        • Nov 2008
                        • 1

                        #12
                        This problem seems to me to have something to do with App.path.
                        If I open a project from windows explorer by clicking the vbp file it picks up a non-VB dll in that folder correctly.
                        If I then close VB, reopen VB and open the project from within VB I get a DLL not found error.
                        I say it is to do with app.path because on another project, for many years, I have had an inconsistency with filling a file listing box with xls files which uses app.path. Sometimes it opens correctly and others, just the first time it is opened, it uses the VB program folder. Close the box and reopen it and it correctly loads xls files from the project folder. Inconsistent - I never had previously figured it out, it was a minor annoyance that fixed itself after App.path had been called for the first time. .
                        Of course to fix it properly for the DLL the dll should be moved to the win32 folder and registered with regsvr. Calling app.path before accessing the dll doesn't fix it!

                        Comment

                        Working...