Can I use C# to create COM related component so that VB6 or VBA can reference it? If so, please direct me how to create a simple C# COM or assembly that my VB6 projects can use.
Thank You
Printable View
Can I use C# to create COM related component so that VB6 or VBA can reference it? If so, please direct me how to create a simple C# COM or assembly that my VB6 projects can use.
Thank You
There is a utility tool on the MS site that lets you use VB 6 stuff in a .NET project or it could be the reverse or both ways. Try a search on the MS site for it.
LM, try any of these:
http://www.dotnet247.com/247referenc...42/213849.aspx
http://forums.devx.com/showthread.php?t=148067
http://www.velocityreviews.com/forum...ll-in-vb6.html
Let me know which one worked. Thanks.
This is possible. After all C# or .NET for that matter was created for inter-language communication. Not primarily but it is a good factor ;)
And rob i think it is the reverse way :) VB forms don't implement COM i think.
I think it serves two purposes:
- one is to minimize the noise (from competitors os course)
- and second to give some backward compatibility to com based languages such as VC++ 6 and VB6.
You can create a .NET dll and expose it via COM so it can be used in VB 6. Also, .NET controls can be used with that utility for use in VB 6.Quote:
Originally Posted by Hell-Lord
http://support.microsoft.com/default...b;en-us;817248
This is exactly what I am looking for. Thank You! :thumb: :afrog: :wave: :D :cool:Quote:
Originally Posted by RobDog888
Actually, I have a question on this.
I successfully got the example to work. However, it seems the dll file that gets produce is not the regular type that you can use Regsvr32.exe. How do I transport this to a machine that does not have .net and only VB6?
Also, it is interesting that you can only do this example with VB.Net and not C#.net. There is simply no COM Class for C#.
Thank you
Anyone?
That link was available in one of those (in the second to be exact) that I posted like half a day earlier.Quote:
Originally Posted by RobDog888
You need to create a Class Library project as suggested in links I posted for you.Quote:
Originally Posted by Liquid Metal
Also, here is an image.
Ah, so it is. Should have pointed it out. :)Quote:
Originally Posted by RhinoBull
I did.Quote:
Originally Posted by RhinoBull
Got it to work with VB.Net but try to do it with C# and you will notice there is no COM class object for C#.
Just do the example but use C# instead.
Did you get a chance to check out what I mention Rhino?
No, sorry - I was sort of away for awhile. Will give it the try if I scramble some time today, tomorrow... Can't promise tho...
Beside the question that C# does not support COM, I found another discovery.
When I create a COM in VB6 and if I come back and delete a pass in argument, that breaks the interface right? I am sure you will agree with me on that. That means that you will have to recompile and a new GUID gets created.
When I create a COM in VB.Net and break the interface, it still uses the same GUID after I compile.
Why is that?
Anyone want to help out?