.NET COM import to VB4

  • Thread starter Thread starter R_O_O_K
  • Start date Start date
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
 
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.
 
Back
Top