C# ClassLibrary External Interface

  • Thread starter Thread starter Tom Roach
  • Start date Start date
T

Tom Roach

Need to create first simple C# ClassLibrary with string property accessible
from VB 6.0 application. Have .NET-created, regasm-registered, and
VB-accessed a prototype --> VB can "see" the property via ObjectBrowser but
can't use it. Other than adding the "public interface" statement and then
adding Properties to it (see below), can someone outline what other steps
are needed?

Thanks for your help!


using System;



namespace CsharpEmailer

{

/// <summary>

/// Summary description for Class1.

/// </summary>

public class Class1

{

public Class1()

{

//

// TODO: Add constructor logic here

//

}

public interface emailer

{



string EmailAttachmentInputString

{

get;

set;

}

}

}

}
 
Tom said:
Need to create first simple C# ClassLibrary with string property
accessible from VB 6.0 application. Have .NET-created,
regasm-registered, and VB-accessed a prototype --> VB can "see" the
property via ObjectBrowser but can't use it. Other than adding the
"public interface" statement and then adding Properties to it (see
below), can someone outline what other steps are needed?

It would appear the interface is a member of the class as opposed to
namespace.

Also, while not absolutely necessary, you really should use attributes
to control what is exposed to COM.

Look at the ComVisible, ProgId, Guid and InterfaceType attributes.
 

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

Similar Threads

COM 2
Implementing Unmanaged Interface in C# 1
C# and VB6 Debugging 1
C++ dll in C# 7
Instance Variables 2
Crud Design Question 13
Interface - Descriptions for Methods/Properties 3
C# Interfaces in C++? 2

Back
Top