S
Saurabh
Hi Gurus,
We are in the process of writing a code in C# and have to use a dll written
in VB through interop and have come across an issue; In one of our other
development projects in Visual Basic 6.0, we are using the dll very
successfully to get a list of all properties of a class exposed by the dll;
say by using the code snippet OleObject.Contacts.Fields.
But when we tried the same thing in the .Net 2003 environment, we could not
get the list of fields. Although the Object browser show the Fields
collection but somehow I am not able to access it through code in the .NET
2003 environment. Here is the code snippet.
public OleObject.Contact oContact = new OleObject.ContactClass();
//Loop through the contact object to get a list of fields
for (int ictr = 0;ictr <= oContact.FieldCount;ictr++)
{
Console.WriteLine("Field : " + actContact.Fields(ictr));
}
Although we are able to access some other properties but not 'Fields'
property. Here is the error I am encountering Error: 'ocontact.Fields' does
not exist
Please help.
Thanks and Regards,
Saurabh
We are in the process of writing a code in C# and have to use a dll written
in VB through interop and have come across an issue; In one of our other
development projects in Visual Basic 6.0, we are using the dll very
successfully to get a list of all properties of a class exposed by the dll;
say by using the code snippet OleObject.Contacts.Fields.
But when we tried the same thing in the .Net 2003 environment, we could not
get the list of fields. Although the Object browser show the Fields
collection but somehow I am not able to access it through code in the .NET
2003 environment. Here is the code snippet.
public OleObject.Contact oContact = new OleObject.ContactClass();
//Loop through the contact object to get a list of fields
for (int ictr = 0;ictr <= oContact.FieldCount;ictr++)
{
Console.WriteLine("Field : " + actContact.Fields(ictr));
}
Although we are able to access some other properties but not 'Fields'
property. Here is the error I am encountering Error: 'ocontact.Fields' does
not exist
Please help.
Thanks and Regards,
Saurabh