Click here to Skip to main content
15,882,113 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
So, basically I have a DLL written in C# that has a main class called Program.cs that contains a public function getSignature.

I need to import and use that DLL in 2 applications; 1 in VB.NET and another in VB6.

In the VB.NET application, I have imported the DLL and called the function as follows:

Dim myService as String
Dim x As New AccountService.Program

myService = x.getSignature("xxxxxxxxxxxx")


This works like a charm and I get my results.

However, for the VB6 part, things get a little tricky.
I couldn't import the DLL as is and had to use RegAsm to generate a TLB file.

I imported the TLB file in my VB6 app and tried the following:

Dim myService As String
Dim x As AccountService.Program

Set x = New AccountService.Program

myService = x.getSignature("xxxxxxxxxxxx")


However, the I cannot access the getSignature function.
The class Program is accessible but not the function within it.

Can anyone please advise as to what I am doing wrong?

What I have tried:

Dim myService As String
Dim x As AccountService.Program

Set x = New AccountService.Program

myService = x.getSignature("xxxxxxxxxxxx")
Posted
Updated 29-Sep-22 19:39pm
Comments
Richard Deeming 29-Sep-22 4:07am    
What's the signature of the getSignature method? Maybe it returns a type that's not COM-visible?

 
Share this answer
 
Comments
Maciej Los 28-Sep-22 17:11pm    
5ed!
Dhanish Balloo 2021 29-Sep-22 2:32am    
doesn't work
still the same.....the class is available but not the function
Finally got it working.

I was missing an Interface in the project.
Added this and linked where needed and pooof......it worked :D
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900