I'm trying to convert the following (simplified) VB.Net code to C#,
that makes use of some externally developed COM code written in VB6.
VB.Net Code
Sub Main()
Dim oAPP As Object
Dim oApp2 As APP2.Class
Dim user As String
Dim pass As String
Dim db As String
Dim var1 as String
User = "user"
pass = "password"
db = "test"
oAPP = CreateObject("VBAPP.Session")
oAPP.Method1(user, pass, db)
oApp2 = oAPP.SessionItem("APP2")
var1 = oApp2.Properties.Item("Date").Value
End Sub
The C# Code looks like
static void Main(string[] args)
{
VBAPP.Session oApp;
APP2.Class oApp2;
string User = "user";
string pass = "password";
string db = "test";
string var1;
oAPP = new VBAPP.SessionClass();
oAPP.Method1(ref User, ref Pass, ref DataSource);
oApp2 = oAPP.get_SessionItem("APP2") as APP2.Class;
var1 = oApp2.Properties.Item(............
}
I'm trying to figure out how to get the same value for var1 as
oApp2.Properties.Item(.. wants a ref Object vIndex
When I add Object d = "Date"; and do oAppProperties.Item(ref d) it
returns System.___ComObject
What am I missing?
Thanks