Click to See Complete Forum and Search --> : .NET to COM intercompability


Lionia
December 6th, 2002, 06:43 AM
Hey, I have a COM client and a .NET server, which have to communicate. But everytime I try to run my client a get this message:
ActiveX component can't create object

Why?????:confused:

TheCPUWizard
December 6th, 2002, 11:46 PM
Some intial ideas...

1) please be aware that your code references the server in it's own bin\debug location. Make sure this is the version that is registered with the O/S. I would suggest removing any/all extra copies.

2) The interface is not configured for COM Interop, this can cause some additional problems.

finally a question, I am assuming that the error occurs on the line:

Dim o As New CSharpCalc

you may want to make a test run with the remainder of the code commented out, just to make sure.


Hope this helps...

Lionia
December 7th, 2002, 10:46 AM
Thanks, those 2 things you are mentioning are a part of a "things-to-do-to-make-a-CCW" and I have done them both:

1) register the assembly you wan't to use and make the typelib:
regasm myassembly.dll /tlb:simpledotnetserver.tlb
2) place the assembly in the same location as the .exe.

I have cheating a bit, because the ex. was taken from chap. 12 in a book named "C# and the .NET platform" by Andrew Troelsen, and I have had some problems following his instruction because I get the creating-component-error in my own application.

I.E. that if I can understanding what is going wrong in his application, I can allso understand it for my own at solve the problem.

So...conclusion, I still have the communication problem between COM client and .NET server..... but thank you very much.