BDRichardson
Programmer
![[sadeyes] [sadeyes] [sadeyes]](/data/assets/smilies/sadeyes.gif)
I would appreciate it if someone can resolve my basic problem with calling a Class from a C# dll, from within VB. I have created a very simple Class library within one Solution, and added a reference to it in a VB Project within another Solution. It would seem that I can call the parent class, but not the sub-class.
For example, I can write:
Code:
Dim CustomSubClass As New ParentClass()
But it will not accept:
Code:
Dim CustomSubClass As New ParentClass.SubClass()
All I want to do is make a custom class which I can reference in different projects. This particular one needs to take an input value, perform some simple manipulation, and return the new value.
C# Class:
Code:
// Ignore the underscores - Added for clarity
using System;
namespace CustomClasses
{
__public class ParentClass
__{
____public static string SubClass(string sValue)
____{
______// Some basic string manipulation code
______return sValue;
____}
__}
}
VB Class:
Code:
Imports CustomClasses
Public Class TestClass
__Dim CustomSubClass As New ParentClass.SubClass()
__Public Sub TestSub()
____Dim sNewValue As String
____sNewValue = CustomSubClass("OldValue")
____MsgBox("OldValue is now: " & sNewValue)
__End Sub
End Class
Please help me!