473,405 Members | 2,444 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Calling C#Dll from Vb6

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


Sep 26 '07 #1
5 1516

"DaveP" <dv*****@sbcglobal.netwrote in message
news:jI******************@newssvr13.news.prodigy.n et...
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
Sep 26 '07 #2
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" <no@no.comwrote in message
news:Oo****************@TK2MSFTNGP05.phx.gbl...
>
"DaveP" <dv*****@sbcglobal.netwrote in message
news:jI******************@newssvr13.news.prodigy.n et...
>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

Sep 26 '07 #3
"DaveP" <dv*****@sbcglobal.netwrote in message
news:cC***************@newssvr14.news.prodigy.net. ..
>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

Sep 26 '07 #4
i have to take prozac everytime i open a vb project
"Michael Starberg" <no@no.comwrote in message
news:ua**************@TK2MSFTNGP06.phx.gbl...
"DaveP" <dv*****@sbcglobal.netwrote in message
news:cC***************@newssvr14.news.prodigy.net. ..
>>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



Sep 26 '07 #5
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

Sep 27 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jeremy R. Harner | last post by:
I'm trying to use a DLL, but when I try to run it from Visual Basic by going to Run > Start I get a 'Bad DLL Calling Convention' error when I try to access a function inside the DLL. If I compile...
5
by: Chris | last post by:
Hi I have a scenario where I've created another AppDomain to dynamically load a DLL(s) into. In this newly loaded DLL I want to call a static method on a class. The problem arise is that I have...
2
by: pieter.breed | last post by:
Hi All, Is it possible to export a c# method into a dll in such a way that your "normal" C application can then call this method? To be clear: I am not asking how to use "DllImport" or...
1
by: Jesse McGrew | last post by:
Hi all, I'm trying to make a plugin DLL for a third-party application, using VC++ .NET 2003. This DLL acts as a bridge between the C++ plugin API of the application, and my actual plugin code...
17
by: Bill Grigg | last post by:
I have been successfully calling DLL's using VC++ 6.0 and also using VC++7.1 (.NET). I only mention this because I have never felt comfortable with the process, but nonetheless it did work....
12
by: scottt | last post by:
hi, I am having a little problem passing in reference of my calling class (in my ..exe)into a DLL. Both programs are C# and what I am trying to do is pass a reference to my one class into a DLL...
2
by: Richard B | last post by:
I added a .NET dll as a reference to my new .NET dll. When I went to build, I received error "Unable to emit assembly: Referenced assembly 'CrystalReport' does not have a strong name". ...
2
by: Daniel Lidström | last post by:
I'm using a library called fyba. This library reads and writes files in a format called sosi. fyba uses the following code to determine if the calling process has own methods to handle errors,...
11
by: briankirkpatrick | last post by:
Forgive me if my post seems a little amateurish... I'm requesting assistance from some of you smart folks out there to get the managed calls write that meet the specification in the esa.h for...
16
by: Jaco Naude | last post by:
Hi there, This is my first post over here and I hope someone can give me some guidance. I'm trying to embed Python into a Visual C++ 2008 application and I'm getting linker problems. I've...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.