Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 25-10-2008
Member
 
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!
Reply With Quote
  #2  
Old 25-10-2008
Member
 
Join Date: Apr 2008
Posts: 1,948
Re: Use .Net created dll in VB6

Start at
http://msdn.microsoft.com/library/de...perati on.asp.
Reply With Quote
  #3  
Old 25-10-2008
Member
 
Join Date: May 2008
Posts: 2,293
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.
Reply With Quote
  #4  
Old 25-10-2008
Member
 
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.
Reply With Quote
  #5  
Old 25-10-2008
Member
 
Join Date: Feb 2008
Posts: 1,848
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
Reply With Quote
  #6  
Old 25-10-2008
Member
 
Join Date: Feb 2008
Posts: 1,848
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
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


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


All times are GMT +5.5. The time now is 10:01 AM.