dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: call VC++ DLL in VB

  1. #1
    Join Date
    Aug 2002
    Posts
    24

    call VC++ DLL in VB

    I 've complied a VC++ dll (see attachment)

    Then I call the function in VB by the following coding:

    Private Declare Sub SetMessages Lib "C:\DLLSHMEM\DLLSHMEM.dll" ()
    :
    :
    Call SetMessages

    But error "file not found" is resulted.
    Can anyone tell me why?
    thanks
    Attached Files Attached Files

  2. #2
    Join Date
    Aug 2002
    Location
    Germany
    Posts
    15
    Your .dll have other dependencys. This opines that your .dll tries to load other .dll´s wich are required. With the microsoft Visual Studio comes a tool , named DEPENDS. With this tool you can see wich .dll your DLL not found.
    Best regards
    Markus

  3. #3
    Join Date
    Apr 2002
    Posts
    174
    Usually Visual C++ puts the .dll files in the \MyProjectDir\debug or \MyProjectDir\release. Check it and if so you can use this declare:

    Private Declare Sub SetMessages Lib "C:\DLLSHMEM\debug\DLLSHMEM.dll" ()

    but it also may be how mdekalle tell you.

    I hope i can help you...

  4. #4
    Join Date
    Aug 2002
    Posts
    24
    Thankx for your replies.

    But I've try Depends and found that all the entities in the dependency tree are modules / duplicate modules with no error

    Also I've complie the dll in the debug folder but still the problem occurs.

  5. #5
    Join Date
    Jun 1999
    Location
    Switzerland
    Posts
    398
    Did you try to put the DLL to the Windows system directory (e.g WINNT\SYSTEM32 for WinNT) and declare it as:

    Private Declare Sub SetMessages Lib "DLLSHMEM.dll" ()
    Leica Geosystems - when it has to be right

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)