Calling C#Dll from Vb6

D

DaveP

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
 
M

Michael Starberg

DaveP said:
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

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
 
D

DaveP

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



Michael Starberg said:
DaveP said:
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

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
 
M

Michael Starberg

DaveP said:
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
 
C

Cor Ligthert[MVP]

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
 
M

Michael Starberg

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top