|
-
Mar 24th, 2006, 06:24 AM
#1
Thread Starter
New Member
need help abt structures
hi all
In my c# application,I am using functions of VC++.Net.
One of the function in that VC++ dll is taking Char * as an argument.
But in My C# application I have one structure variable.
I want this structure variable to be passed to that VC++.Net dll's function.
This is in C#.Net
structure struct1
{
int i;
char[] arr;
};
Am writing the following code under Button_click event(in C#)
struct1 ss=new struct1()
ss.i=10;
ss.arr=new char[10];
ss.arr="abcde".ToChararray();
work(ss); ?? /***** this is the function in vc++.net ****??????????
Now I want to pass thi structure variable(struct1) to the VC++.Net function which is having char * as its argument.
The function in VC++.Net is like this..
char * work(char * C)
{
/// some code
}
So plzz tell me Can I pass the structure from C#.Net to that VC++.Net function which is taking Char *.
Thanks in advance.
-
Mar 24th, 2006, 01:33 PM
#2
Re: need help abt structures
Look into "unsafe" code and pointers (C# does support pointers). MSDN has some good info about it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|