namespace Sample
{
[Guid("FDB56085-E1C2-41E3-8B6A-86F734B9338B")]
public interface ITest
{
#region Methods
void Foo();
void Bar();
#endregion
}
[ComVisible(true)]
[ClassInterface(ClassInterfaceType.None)]
[Guid("6717C7FC-9E3F-47A1-955C-09734F96B18F")]
public class Test: ITest
{
#region Public Methods
public void Foo()
{
}
public void Bar()
{
}
#endregion
}
}
All this compiles fine and any code I insert into Foo() or Bar() will execute without a problem. However, I can also do this in VB6: Dim tAs Sample.Test
t.Foo
t.Bar
t.CompileError
and the compiler doesn't complain at all. At runtime the last line does generate an error indicating that the method is not implemented but nothing at compile time. Also, the entire class is not browsable in the Object Browser. I can live with the 2nd part but I'm hoping there's a way to force the compiler to catch such errors during compilation. Any suggestions?
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.