If you don't want to overload it, then you will have to allocate the
space in memory (which you will need to look at the static Size property on
to get the size of the IntPtr on the platform you are running on) and then
pass the pointer to that memory to SendMessage.
You can do this with the CoTaskMemAlloc and CoTaskMemFree methods on the
Marshal class, and then use the Write* methods on the Marshal class as well
to write the contents to memory (the actual value).
If you want to use unsafe code, you can always just pass the pointer to
the location of the variable on the stack as well.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Johnny" <no_spam@_nospam.comwrote in message
news:eN**************@TK2MSFTNGP05.phx.gbl...
>I have to "P/Invoke" to a function taking an LPARAM arg which is
actually an
"IntPtr". In this case "IntPtr" needs to be a pointer to an "unsigned
int".
Can someone enlighten me on how to pass this. Thanks.
The easiest way to define the parameter type as ref uint (as long as
it should point to just a single uint and not an array).
Thanks for the info. I was hoping to avoid that however since it's
"SendMessage()" I'm calling. I don't want to have to overload it everytime
I need it. I'd also like to know how to do this anyway, just for my own
knowledge (my roots are C/C++). Do you know if it can be done? Thanks
again.