Results 1 to 6 of 6

Thread: Use .Net created dll in VB6

  1. #1
    Join Date
    Aug 2006
    Posts
    221

    Use .Net created dll in VB6

    I need to call a .net created dll in VB6 project. It always give me this error, when I create instance of this class "error 2147024894(80070002) File or assembly name DllName, or one of its dependencies, was not found." This error was happened on a machine with .net runtime installed only. It runs fine in a machine with .net developer version installed.

    Does anybody has any idea? Thanks a lot!

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    Re: Use .Net created dll in VB6


  3. #3
    Join Date
    May 2008
    Posts
    2,297

    Re: Use .Net created dll in VB6

    There are the steps to follow:

    1. Create a class library in VS choose whatever language you want either Vb.NEt
    2. or C#
    3. Goto to Project Properties->ConfigurationProperties->build, check the Register for Com Interop checkbox. This creates the COM wrapper for your .NET assembly and hence need not use regasm.
    4. Write whatever code you want, expose the classes publicly, expose the properties, functions you want publicly.


    Now in your VB project, add the classlibrary.tlb created by the above program.
    Now use the classes and functions as you want.

    you shoudl not have any problem.

  4. #4
    Join Date
    Nov 2005
    Posts
    1,323

    Re: Use .Net created dll in VB6

    Hi Beter 2 Burn Out

    When you deploy a .NET DLL, and you want to use it with COM (such as VB),
    you need to register it with "Regasm.exe your_aseembly_file /codebase".
    you need to include the /codebase switch when registering assembly in folders
    other than GAC.

    To use the /codebase switch, the assembly must be strongly-named.

  5. #5
    Join Date
    Feb 2008
    Posts
    1,852

    Re: Use .Net created dll in VB6

    hi,

    I have created a .net dll with Register For Com Introp option to true and also Signed it. I have copied .dll and .tib files to another machine and registered it with Regasm command. I opened Visual Studio 6.0 and tried to add reference of .dll file, it throws error "Can't add reference" and when I tried to add .tib file, reference added but I cannot see my Namespace/Class though they are public !

    Am I missing some step over here?

    Thanks

  6. #6
    Join Date
    Feb 2008
    Posts
    1,852

    Re: Use .Net created dll in VB6

    Hi,

    It was same typical windows problem. We need to restart the machine after Regasm command.

    so fixed it.

    Thanks

Similar Threads

  1. How Objects of class are created in C++?
    By Alibamu in forum Software Development
    Replies: 4
    Last Post: 29-12-2010, 06:24 AM
  2. Who created Combofix
    By Madhuparna in forum Networking & Security
    Replies: 6
    Last Post: 22-07-2010, 12:01 AM
  3. Using VBA to a DLL created in VB6
    By Pratyush in forum Software Development
    Replies: 5
    Last Post: 12-03-2009, 11:42 AM
  4. How to reset password created in PHP
    By KaramChand in forum Software Development
    Replies: 4
    Last Post: 05-02-2009, 10:28 PM
  5. XP asking for a password that was never created!
    By Farley in forum Operating Systems
    Replies: 3
    Last Post: 24-10-2008, 04:24 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,559,672.84513 seconds with 17 queries