1,105,226 Community Members

Using a C# dll in VB6

Member Avatar
mayzebra
Newbie Poster
2 posts since Dec 2007
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

I'm in the process of converting a complex system from VB6 and C to C#. However now I'm in a position where I need to call a C# dll from VB6 and I need it yesterday. The only solution I found was using Interop, which didnt work, and seemed to be excessively complex on the installation end. Any suggestions?

Member Avatar
SCBWV
Junior Poster
125 posts since Apr 2007
Reputation Points: 29 [?]
Q&As Helped to Solve: 24 [?]
Skill Endorsements: 0 [?]
 
0
 
Member Avatar
hkdani
Posting Pro in Training
433 posts since Nov 2007
Reputation Points: 39 [?]
Q&As Helped to Solve: 46 [?]
Skill Endorsements: 2 [?]
 
0
 

However now I'm in a position where I need to call a C# dll from VB6 and I need it yesterday.

That would be nice, if it were possible.

I know you can use a VB6 ActiveX component in .NET, but I really doubt you can go the other way.

I have some projects I would like to complete using some drop in .NET components in VB6, but they will not load in VB6.

Member Avatar
devmakwana
Newbie Poster
4 posts since Sep 2009
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

i mad C#.net library and build it. Please some one Help me to Use this Library in to My Vb6.0 Application.
What i do for this
(1) Build the Library using csc (C#.NET) - Successful
(2) Regasm /tlb: <library.tlb> library.dll - Successful
(Note : This LIbrary have the Strong Name)
(3) Gacutil /i <library.dll> - Successful

(4) i make refrence <library.tlb> into my VB6.0 application.

result -> only class is exposing. But No Method, Property, Variable or even.

please some one help me.

Member Avatar
vb5prgrmr
Posting Virtuoso
1,670 posts since Mar 2009
Reputation Points: 143 [?]
Q&As Helped to Solve: 299 [?]
Skill Endorsements: 3 [?]
 
0
 
Member Avatar
nirdeshdabas
Newbie Poster
1 post since Feb 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

One simple way could be (Way around instead, if you are interested)
1. Create SQLCLR in C#
2. Deploy it as a stored procedure in SQL
3. Now in vb6 just call a stored procedure and it can call your C# code.

Cheers.
Nirdesh

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article