hi friends,
This is really urgent, Pls.
Can C access C# classes?
I am doing an interop with a C# library and a C library.
The code for the C# library is like this
namespace LibraryNamespace
{
using System;
..........
[Guid("32511C6F-B0AB-4cc9-92E8-2D1FDDDD012C")]
public interface IManagedInterface
{ string getValue(string name);}
[Guid("CD034B6C-FB86-445e-822B-E70BEEEE6995")]
public class LibraryImplementation : IManagedInterface {
public string getValue(string name) {
Library.WebService.OService myService = new Library.WebService.OService();
string str;
StringBuilder sb = new StringBuilder();
StringBuilder spce = new StringBuilder("=");
DataSet ds = new DataSet();
str = myService.getName2(name,opt,sze);
TextWriter tw = new StreamWriter("XMLString.xml");
tw.WriteLine(str.ToString());
tw.Close();
ds.ReadXml("XMLString.xml");
foreach (DataRow dr in ds.Tables[0].Rows)
{
sb=sb.Append(dr["XYZ"];
}
return (Convert.ToString(sb)); }}}
Now, instead of returning a string to the C code, I want to return a
structure so that I could directly map the results to the structure at the C
code instead of parsing and converting the strings.
(1) Where should I declare the structure in the C# code and how, pls give
example
(2) How can I access that in the C code and will it understand the C#
structure.
Pls Help.
Thanks