Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / September 2007

Tip: Looking for answers? Try searching our database.

Calling C#Dll from Vb6

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DaveP - 26 Sep 2007 19:40 GMT
Hi all...im looking for example of
calling a method or class in c# dll from vb6

i have a Class writen in c#
Ii want to call it from vb6 (ie Not a c# exe, DLL)

tia
DaveP
Nicholas Paldino [.NET/C# MVP] - 26 Sep 2007 19:52 GMT
Dave,

   I would look at the section of the .NET documentation titled "Exposing
.NET Framework Components to COM", located at:

http://msdn2.microsoft.com/en-us/library/zsfww439(VS.71).aspx

Signature

         - Nicholas Paldino [.NET/C# MVP]
         - mvp@spam.guard.caspershouse.com

> Hi all...im looking for example of
> calling a method or class in c# dll from vb6
[quoted text clipped - 4 lines]
> tia
> DaveP
Michael Starberg - 26 Sep 2007 20:26 GMT
> Hi all...im looking for example of
> calling a method or class in c# dll from vb6
[quoted text clipped - 4 lines]
> tia
> DaveP

Well, this is pretty easy to do,
Just expose your C# assembly as COM,
and it will work just fine in your VB6 code.

[singing]
But there is a part of me
that would like to tell
and thereby lie
that it is impossible..
Just to have you re-write
your entire application
- Just to rid the world of VB6 =)

But, I am happy too see you are moving in the right direction.

Visual Basic Sucks So Hard It Bends Light
- Michael Starberg
DaveP - 26 Sep 2007 20:42 GMT
I agree, i would never write vbcode and i still hate it...
this is legacy code
For the time being i can't rewrite yet
But im trying to slowly a Part at a time
DaveP

>> Hi all...im looking for example of
>> calling a method or class in c# dll from vb6
[quoted text clipped - 22 lines]
> Visual Basic Sucks So Hard It Bends Light
> - Michael Starberg
Michael Starberg - 26 Sep 2007 21:46 GMT
>I agree, i would never write vbcode and i still hate it...
> this is legacy code
> For the time being i can't rewrite yet
> But im trying to slowly a Part at a time
> DaveP

Well, I'll pray for you.
Anyone doing VB6 without wanting to,
deserves to have a candle lit for him/her.

But you will find that it is easy to get an
assembly to work in the COM-world.
Just a checkbox if I remember correctly.

In the meantime, you can always laugh with Verity Stobs:
- Thirteen Ways To Loath VB:

http://www.ddj.com/windows/184403996

Candle Lit
- Michael Starberg
DaveP - 26 Sep 2007 22:37 GMT
i have to take prozac everytime i open a vb project

>>I agree, i would never write vbcode and i still hate it...
>> this is legacy code
[quoted text clipped - 17 lines]
> Candle Lit
> - Michael Starberg
Michael Starberg - 27 Sep 2007 22:08 GMT
>i have to take prozac everytime i open a vb project

I usually settle for coffee.

But when I maintain VB6 code,
I am always thinking that I need LSD
to even begin to understand what the
original coder was trying to do.
And what all the patches ontop of that
was trying to solve in panic.

I wonder if there is a support group for this?

-  eh, eh, I've been like a VB6 maintainer for..
.. a long time now...
.. sometimes I get VB6, but sometimes they only give me VBA
.. for office-applications..
.. also, I had to do vbscript in asp, just to get a new hit
.. been doing that...
.. for like 6 years now. I'm shaking and can't sleep
.. because of all the nightmares.
.. my name is Michael

- HELLO MICHAEL, we are here for you...

Luckely for me, C# came to the rescue.
Also, I have still a pretty complex
Delphi7 application that I work on, on my free time.

If not, I'd been in that support group,
becoming Tyler Durden making viruses targeting COM. :)

Cato said in the Roman Senate
that Carthago should be destroyed.
That is a missspelling by the dude taking notes,
or maybe the Cato was a wee drunk and slurled it out
but, he ment that COM should be be destroyed.

See, that is what I call an insight.

But Bill don't take orders from Cato, now does he. =)

- Michael Starberg
Cor Ligthert[MVP] - 27 Sep 2007 05:13 GMT
Michael,

> Visual Basic Sucks So Hard It Bends Light

Any reason, just try the VBNet version from what is in C# the switch, maybe
that is the first start in loving VBNet.

Cor

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.