.NET COM import to VB4

R

R_O_O_K

Hi!

I have created a simple COM class in VC# (ie "Hello World" through
Windows.Forms.MessageBox). When I try to use it in VB4 I get an error
saying that the server CLSID {GUID...} can not be loaded. Is it at all
possible to use .NET COM classes in VB4?

Best regards
Michal Ziemski
 
P

Phil Wilson

There are all kinds of gotchas that you need to deal with, so you should say
what you've tried so far. The C# class library needs registering (with
regasm or equivalent), it pays to be explicit in the COM class about
ComVisible, GuidAttribute, and a default constructor. Declaring an interface
with a Guid wouldn't be a bad idea either, sio that you kniw exactly what
your exported COM data really is. It doesn't help that the default project
assemblyversion is 1.0.* and consequently changes on every build, but it
really needs locking down to get your project into a stable state. When it
gets down to the details, the interop ng would be the best for questions.
 

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