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

Hybrid View

  1. #1
    Join Date
    Nov 2004
    Posts
    30

    Use .net dll in VB6?

    I want use a .net dll in vb6. I have selected "Register for COM Interop" in VS.net proyect. I have registered dll with resgam. I have generated .tlb file. I have add in references tlb file. But when I run it tak error "File or asembly name xxxx , or one of its components, was not found".

    Before register with resgam the error was "ActiveX component can't create object".
    Do you know how use .net dlls in vb6?
    Thanks
    _______________
    Hip Hop
    Foro heavy

  2. #2
    Join Date
    Jun 2004
    Location
    Kashmir, India
    Posts
    6,808

    Re: Use .net dll in VB6?

    Take a look at this tutorial http://msdn.microsoft.com/library/de...ertutorial.asp. This might help a bit in understanding how COM interop actually works. This is in C# but should be helpful in this case.

  3. #3
    Join Date
    Nov 2004
    Posts
    30

    Re: Use .net dll in VB6?

    Thanks I have solve it.
    But now I have another problem, when I write "object." it don't shome the public methods of the class (after write dot).
    If I write method it runs ok, but can I show the methods of the class when I write dot after de object?
    Thanksss

  4. #4
    Join Date
    Jun 2004
    Location
    Kashmir, India
    Posts
    6,808

    Re: Use .net dll in VB6?

    Quote Originally Posted by wakeup
    Thanks I have solve it.
    But now I have another problem, when I write "object." it don't shome the public methods of the class (after write dot).
    If I write method it runs ok, but can I show the methods of the class when I write dot after de object?
    Thanksss
    This is because you are use Late Binding. Late Binding means that compiler will only come to know about the actual ActiveX at run-time. This is the reason why inteli-sense of VB doesn't work when you declare objects using generic object class.

  5. #5
    Join Date
    Nov 2004
    Posts
    30

    Re: Use .net dll in VB6?

    How can I solve it?
    thanks

  6. #6
    Join Date
    Jun 2004
    Location
    Kashmir, India
    Posts
    6,808

    Re: Use .net dll in VB6?

    Quote Originally Posted by wakeup
    How can I solve it?
    thanks
    You will have to use Early-Binding. I would declare my object like this to
    Code:
    Dim myObject As New NetObjectClass
    Where NetObjectClass is the names of the Class you created in .NET.

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