There is a section in MSDN on P/Invoke:
http://msdn.microsoft.com/library/de...structures.asp
and an article how to pass structure:
http://msdn.microsoft.com/library/de...structures.asp
A good idea is to look at Interop Marshalling for specific data types
marshalling, for instance strings in different cases. Have a look at the
following:
http://msdn.microsoft.com/library/de...edatatypes.asp http://msdn.microsoft.com/library/de...edatatypes.asp
You should be most happy with:
http://msdn.microsoft.com/library/de...uctssample.asp http://msdn.microsoft.com/library/de...infosample.asp
Articles are not long, and samples are very clear and meaningful. Worth
browsing and looking for an adequate sample you need.
--
Cezary Nolewajka
mailto:c.*********************@no-sp-am-eh-mail.com
remove all "no-sp-am-eh"s to reply
"adrin" <ad***@adrin.adrin> wrote in message
news:Xn***************************@193.110.122.80. ..
hi i have the following problem:
i use functions from an external dll(normal w32 unmanaged library) which
takes a structure address as an argument..
how do i pass it in c#?
i tried using array instead od struct and fixed statement to get a
pointer, it seemed to work, but i bet there is a better and more elegant way to do
that
and a second issue which is more imprortant :)
one member of the structure given as an argument(or rather address of
which is given as an arg) is a pointer to a callback function... how do i get
function pointer in c# and pass it to that unmanaged code, so it can be
called from that code in the future?
please help me, i would be very grateful.