|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
problem in calling winapi that use pointer to struct from c#hi am using panel with autoscroll , now i want to call window api
BOOL GetScrollInfo(HWND hwnd, int fnBar, LPSCROLLINFO lpsi)); now am doing like tht unsafe public static extern bool GetScrollInfo(uint hwnd,uint SB_HORZ, SCROLLINFO* si ); but it causes a problem in lasst parameter , pls help -- amit bharadwaj Hi amit
The best thing to do is to use the pinvoke website to find this sort of information: Try this URL for GetScrollInfo: HTH Nigel Armstrong http://www.pinvoke.net/default.aspx/user32.GetScrollInfo Show quote "amit bharadwaj" wrote: > hi am using panel with autoscroll , now i want to call window api > BOOL GetScrollInfo(HWND hwnd, int fnBar, LPSCROLLINFO lpsi)); > > now am doing like tht > unsafe public static extern bool GetScrollInfo(uint hwnd,uint SB_HORZ, > SCROLLINFO* si ); > > but it causes a problem in lasst parameter , pls help > -- > amit bharadwaj > On 25/11/2004 amit bharadwaj wrote:
> hi am using panel with autoscroll , now i want to call window api Try:> BOOL GetScrollInfo(HWND hwnd, int fnBar, LPSCROLLINFO lpsi)); > > now am doing like tht > unsafe public static extern bool GetScrollInfo(uint hwnd,uint > SB_HORZ, SCROLLINFO* si ); > > but it causes a problem in lasst parameter , pls help public static extern bool GetScrollInfo(uint hwnd, uint SB_HORZ, ref SCROLLINFO si); You don't need 'unsafe' then. You can also declare the hwnd as an IntPtr which is often easier. As somebody else pointed out pinvoke.net can be helpful or microsoft.public.dotnet.framework.interop. -- Jeff Gaines Damerham Hampshire UK |
|||||||||||||||||||||||