473,406 Members | 2,220 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 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 3288
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ken Lindner | last post by:
I have a need to become familiar with SQL Server 2000 for work. Needless to say I am new to SQL Server any version, but not IT in general. My employer has provided me with the SQL Server 2000...
7
by: lvpaul | last post by:
Hallo ! I am using IIS-Windows-Authentication in my intranet (web.config <authentication mode="Windows" /> <identity impersonate="true" /> How can I get the users (client) IP-Address ? I...
7
by: Tyler Foreman | last post by:
Hello, I have a strange problem that occurs every so often in my application. It usually takes place when I hide one form and activate another. What happens is I get the following exception:...
1
by: Scott Davies | last post by:
Hi, I'm looking for some help on a small program that I'm trying to develop in VB.NET. I'm having trouble getting the code that I've written to work, can anyone shed some light as to where I'm...
0
by: Scott Davies | last post by:
Hi, I'm looking for some help on a small program that I'm trying to develop in VB.NET. The program I'm trying to develop needs to be able to do the following: - Select remote server -...
4
by: Rod Gill | last post by:
Hi, I have a form that when opened in the designer appears of the screen. The form selector can't be dragged (or resized) and if I scroll right and down to centralise it the form simply jumps...
2
by: sambo251 | last post by:
After running a few updates I get this very annoying "Windows Installer" error #1706 that will ne go away! It keeps saying that it cannot find the file "instantsharedevices.msi", that it is on...
1
by: mfunkmann | last post by:
Hi, I recently got an error and I don't know how to fix it: Error 1 'System.Data.DataColumn' does not contain a definition for 'Windows' C:\c#\CsharpPRO\Form1.Designer.cs 304 77 CsharpPRO I...
0
AmberJain
by: AmberJain | last post by:
Windows Autorun FAQs: List of autostart locations Linked from the Original article- "Windows Autorun FAQs: Description". Que: Can you list all the autostart locations for windows? Ans: Here is...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.