Results 1 to 5 of 5

Thread: Reference Problem

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2007
    Posts
    11

    Reference Problem

    I am trying to reference a third party dll. I get an error "No type libraries were found in the componant." Whats up with that? I think it was written in C++, I am using VB.Net. I have the .h and a .lib files. What can I do?

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Reference Problem

    Do you have documentation for the library? My guess is that it is not a COM component and rather has exported functions. In that case you don't reference the library in your project but rather declare the exported functions in your own code and execute like Windows API functions.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3
    Addicted Member
    Join Date
    Feb 2007
    Posts
    180

    Re: Reference Problem

    I'm kinda having the same problem. It wont let me reference it. I'm new to vb.net, so how would one declare a dll? I have a 134 page PDF file with all VB 6.0 examples, so translating is going to be fun. I had this DLL running in 6.0 about 6 months ago, however the DLL came with a .BAS wrapper, so it made life SO easy.

  4. #4

    Thread Starter
    New Member
    Join Date
    Apr 2007
    Posts
    11

    Re: Reference Problem

    It came with a developer's kit for a satalight modem. I am trying to write a web app to poll the modem, which won't be too hard once I can call their functions. The documentation states that I can use the dll with vs2005. I am in contact with the Tech Support, but I like to do my homework. How would I call this as an api? I havn't written code for a few months and forgot most of what i halfazed learned.

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Reference Problem

    If your library does indeed export functions rather than expose a COM interface then you need to write a declaration for each function you want to use in your VB code using either the Declare statement or the DllImport attribute. Once that's done you can call the function just as you would any other. Check out the MSDN documentation for the Declare statement and the DllImportAttribute class for details.

    If you already have VB6 declarations then it may be easier to use the Declare statement. Generally the VB.NET declarations are almost exactly the same with just Integer used instead of Long. That said, applying the DllImport attribute is the "more .NET" way of doing it and would be preferable.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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