First, you cannot have *mystruct2 in C#. C# doesn't have pointers. And no
you still can't do pointer to struct, though you can do AddressOf
(FunctionName). Thats about the only pointer like thing you have in C#/.NET.
That is hella useful for our equivalent of callback functions.
Secondly structs in C# are very different from structs in C++. In C++ a
struct is a class with all members public, in C# a struct is a value type
which is always declared inline/stack (versus heap in C++). It is not a
class in C#.
What you really need is a class, not a struct. .. and atleast I donot know
of a way to do *LPMyStruct1, though maybe if I saw the actual code .. I
could take a shot at it.
--
- Sahil Malik
Independent Consultant
You can reach me thru my blog at -
http://www.dotnetjunkies.com/weblog/sahilmalik/
"marabo82" <ma******@discu ssions.microsof t.com> wrote in message
news:24******** *************** ***********@mic rosoft.com...
Hi,
i know that typedef structs creates an aliases for a particular struct in
C++. i m trying to convert .h c++ files to a namespace in C#.net so that i use
C++ DLL in my C# application.
one of the structs in C++ is something like
typedef struct mystruct {....} mystruct1, *mystruct2;
since typedef is used, mystruct1 and *mystruct2 are aliases to mystruct.
how can i acheive the same (i.e aliasses in c#)? i can subtitute mystruct1
and *mystruct2 in the C# namespace (which i am creating) by mystruct. but i
am not sure if they are used in the DLL? your help is greatly appreciated. i am new to DLL and C#
thanks