471,605 Members | 1,354 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,605 software developers and data experts.

C# and Windows API

Hi !
I am working over windows API but i am stuck with few structs of win
dll's that how can i use them using PInvoke (as i cant use Interop so i
have to go with PInvoke).
The problem is that how can i convert Windows Struct and deffinations
into C# deffinations to delcare them atleast.
Can some one reffer me any article or suggest me how to do.
Regards,
Usman Bashir
Jan 9 '06 #1
3 3239
Hello Usman,

Your best bet is to check out www.pinvoke.net. The have a lot of the Win32
API definitions in C#. If you have specific structs you need that aren't
published there post back with those and we'll try to help you out.

--
Jared Parsons
ja****@beanseed.org
http://jaredparsons.blogspot.com
Hi !
I am working over windows API but i am stuck with few structs of
win
dll's that how can i use them using PInvoke (as i cant use Interop so
i
have to go with PInvoke).
The problem is that how can i convert Windows Struct and
deffinations
into C# deffinations to delcare them atleast.
Can some one reffer me any article or suggest me how to do.
Regards,
Usman Bashir

Jan 9 '06 #2
Jared Parsons wrote:
Hello Usman,

Your best bet is to check out www.pinvoke.net. The have a lot of the
Win32 API definitions in C#. If you have specific structs you need that
aren't published there post back with those and we'll try to help you out.

Thanks Parsons!
i did check the site but unable to find the required method there too.
Actually i m working with MAPI32 and i need this method to get the list
of messages. The declaration in mapi32 and my suggested declartion is
given below;
{windows Declartion)
HRESULT HrQueryAllRows(
LPMAPITABLE ptable,
LPSPropTagArray ptaga,
LPSRestriction pres,
LPSSortOrderSet psos,
LONG crowsMax,
LPSRowSet FAR * pprows
);

(my proposed)
[DllImport("MAPI32.DLL", CharSet = CharSet.Ansi, EntryPoint =
"MAPIFreeBuffer@4")]
private static extern int HrQueryAllRows(IntPtr pTable,IntPtr
pProp,IntPtr pRest, IntPtr pSort,long wCount,IntPtr lpRows);

//But again i m not sure how to use it after getting the interface
pointer. i do have samples in C++ but surelly it become ambigous while
casting them in C#.
Thanks in advance.
Regards,
Usman Bashir
Jan 9 '06 #3
Hi,

"Usman" <gr*****@gmail.com> wrote in message
news:ei**************@TK2MSFTNGP09.phx.gbl...
Jared Parsons wrote:
Hello Usman,

Your best bet is to check out www.pinvoke.net. The have a lot of the
Win32 API definitions in C#. If you have specific structs you need that
aren't published there post back with those and we'll try to help you
out.

Thanks Parsons!
i did check the site but unable to find the required method there too.
Actually i m working with MAPI32 and i need this method to get the list of
messages. The declaration in mapi32 and my suggested declartion is given
below;


If you did not find it there try looking for it in the newsgroups archives,
if you find your solution, PLEASE update pinvoke.net so the next one will
save time.

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Jan 9 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Tyler Foreman | last post: by
1 post views Thread by Scott Davies | last post: by
reply views Thread by Scott Davies | last post: by
4 posts views Thread by Rod Gill | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by MichaelMortimer | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.