954,568 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

how to use dll files in Visual basic 6.0

I have created a DLL files using C#....

How can i use it in Visual Basic 6.0?

Please help me with this project...can you give me codes for it or step by step procedure

THANK YOU!!!!!!!!!!!!

dlayante
Newbie Poster
11 posts since Jun 2008
Reputation Points: 10
Solved Threads: 0
 

you need to register that DLL with windows using the REGSVR32 key and then refer that ddll from Project------> Reference menu of VB IDE.

Next you need to create objects of the class and call its objects.

debasisdas
Posting Genius
6,872 posts since Feb 2007
Reputation Points: 666
Solved Threads: 434
 

Thanks for reply debasisdas,...How's that? how can I register my DLL using REGSVR32?

Anyweiz here's the DLL i make from C#:

using System;
using System.Collections.Generic;
using System.Text;

namespace MyDLL
{
public class Class1
{
public int addnumbers(int a, int b)
{
return a + b;
}
}
}

I just need to call and use it in Visual Basic wherein I can Add numbers when I click a button!....

dlayante
Newbie Poster
11 posts since Jun 2008
Reputation Points: 10
Solved Threads: 0
 

I've found it easyest to copy the dll to the system32 folder then run the below

get a command prompt (start run cmd)

type in
regsvr32 dllname

bushman_222
Junior Poster in Training
65 posts since Jan 2008
Reputation Points: 10
Solved Threads: 4
 

copy the dll to system32 folder and then from start----->RUN

execute the command REGSVR32 DLL filename

debasisdas
Posting Genius
6,872 posts since Feb 2007
Reputation Points: 666
Solved Threads: 434
 

please send how download the regsvr required .dll file

umesh bet
Newbie Poster
1 post since Oct 2011
Reputation Points: 7
Solved Threads: 0
 

its not to download from any where. REGSVR32 file is locataed at your windows drive (like c:\windows\system32\REGSVR32.exe) just you have to double click on dll file or right click and open with then select file from c:\windows\system32\REGSVR32.exe
after confirmation, your file is registered now.
and then refer that dll from Project------> Reference menu of VB IDE.
Next you need to create objects of the class and call its objects.


Enjoy

ImranQureshi
Newbie Poster
12 posts since Sep 2011
Reputation Points: 10
Solved Threads: 0
 

when i register the dll file using 'project --> references', i got this error message
"Can't add a reference to the specified file."
what's wrong?

kejuqeju
Newbie Poster
1 post since Dec 2011
Reputation Points: 10
Solved Threads: 0
 

Good grief. You're using a C# .NET DLL and trying to place it in VB6?

Maybe you're really trying to place a C or C++ .NET DLL and place it a Visual Basic 6 project? In which case, you're in the wrong forum. Go to the Visual Basic .NET forum.

I don't believe a C++ .NET DLL is compatible with VB6. I've tried this before and have had the same result as you posted: "Can't add a reference to the specified file."

You can create a DLL using the C or C++ programming language to use in VB6. But you have to follow the guidelines for working with VB6. I don't even know that you can create a C# DLL.

hkdani
Posting Pro in Training
435 posts since Nov 2007
Reputation Points: 49
Solved Threads: 47
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You