4

Duplicate of Calling .NET methods from VB6 via COM visible DLL

Which ways exist to use/call .NET classes/functions/libraries (.net 3.x) in VB6 or classical ASP ? Has anybody experiences with that ? How much effort is necessary to wrap .NET to COM ? Are there tools which help ?

Community
  • 1
  • 1
Michael
  • 39
  • 2
  • 1
    That question is not a duplicate - it's a very specific question about a problem with a particular routine. This question is much more general. – MarkJ Jan 25 '10 at 19:17
  • Does this answer your question? [Calling .NET methods from VB6 via COM visible DLL](https://stackoverflow.com/questions/233284/calling-net-methods-from-vb6-via-com-visible-dll) – TAbdiukov Jan 16 '20 at 04:52

5 Answers5

2

It's pretty easy actually and I have created .NET components called from both VB6 COM dlls and Classic ASP. You essentially need to create a COM callable wrapper thats exposes the .NET component to a COM client. This article will get you started

Calling a .NET component from a COM component

A couple of pointers

  • Any COM callable types will need a public parameterless constructor
  • Mark public any methods, properties or events that you want to expose to COM.
  • It's a good idea to explicitly implement an interface as opposed to relying on one to be generated from your class for you.
Russ Cam
  • 121,250
  • 30
  • 197
  • 258
1

Yes it is possible. .Net has functionality for generating a COM wrapper.

This is covered in this question: Calling .NET methods from VB6 via COM visible DLL

  • Call .net classes from VB6 is done using a COM wrapper. This is the same in 2.0 as in 3.5. However, it is supposed to be much improved in 4.0.
  • The effort is the same as working with COM in general
  • In visual studio there is a setting "COM visible", if you check this VS will do a lot of the work generating the wrapper
Community
  • 1
  • 1
Shiraz Bhaiji
  • 62,289
  • 31
  • 137
  • 240
0

You might want to read this article:

http://www.codeproject.com/KB/COM/cominterop.aspx

Charlie
  • 10,080
  • 9
  • 50
  • 89
0

You can make .NET assemblies expose COM, therefore you can access the classes by any technology/programming language which has COM support. See this link for example.

Oliver Hanappi
  • 11,682
  • 7
  • 51
  • 68
0

I would recommend the following reading: http://www.sdltridionworld.com/articles/vs2005_to_com_and_dotNET_1.aspx

Kottan
  • 4,846
  • 9
  • 40
  • 67