C# ClassLibrary External Interface

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;

}

}

}

}
 
F

Frank Oquendo

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

Top