473,387 Members | 1,673 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,387 software developers and data experts.

wanted: help translating MapVirtualKeyEx to PInvoke

Can someone kindly help me finish my attempt at pinvoke? HKL is a void* and
I don't know how to translate it.
[DllImport("user32.dll", SetLastError = true)]
//static extern UInt32 MapVirtualKeyExW(UInt32 uCode, UInt32 uMapType, HKL
dwhkl);

Here is the function:
http://msdn.microsoft.com/en-us/libr...07(VS.85).aspx

Thanks!

Siegfried
Sep 10 '08 #1
3 2977
http://www.pinvoke.net/default.aspx/...tualKeyEx.html

"Siegfried Heintze" <si*******@heintze.comwrote in message
news:uL**************@TK2MSFTNGP03.phx.gbl...
Can someone kindly help me finish my attempt at pinvoke? HKL is a void*
and I don't know how to translate it.
[DllImport("user32.dll", SetLastError = true)]
//static extern UInt32 MapVirtualKeyExW(UInt32 uCode, UInt32 uMapType, HKL
dwhkl);

Here is the function:
http://msdn.microsoft.com/en-us/libr...07(VS.85).aspx

Thanks!

Siegfried

Sep 10 '08 #2
Wow! Great tip! I had to search seperately for the MAPVK constants but I
found them!

They were in VB though! I translated them by hand.

How can I search for constant definitions in C#?
How can I search for functions in VB?

Seems like there should be C#/VB checkbox.
Sep 11 '08 #3
The pinvoke site is user driven, meaning people submit the help. If there
is no C# or VB code for a function, then someone needs to submit it. The
constants are constants in any language, but you do have to convert &H0A to
10, for example.

"Siegfried Heintze" <si*******@heintze.comwrote in message
news:u5**************@TK2MSFTNGP04.phx.gbl...
Wow! Great tip! I had to search seperately for the MAPVK constants but I
found them!

They were in VB though! I translated them by hand.

How can I search for constant definitions in C#?
How can I search for functions in VB?

Seems like there should be C#/VB checkbox.
Sep 11 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Ted | last post by:
Is it possible to use mailslots in .NET using PInvoke? I have a VC++ 6.0 based app that creates and listens to a mailslot. I have a second VC++ 6.0 based app that opens the mailslot and writes...
5
by: Carlos Guzmán Álvarez | last post by:
Hello: I'm trying to execute a function of a unmanaged dll using PInvoke, i have definied the function as: public static extern int isc_dsql_prepare( int status_vector, ref int...
3
by: Brett Robichaud | last post by:
I have created a simple background thread to make one pinvoke call into a DLL I've created. My Winforms app spawns the thread in the form load event then go about it's business. The problem is...
5
by: vertigo | last post by:
Hello I use some win 32 API function for example: HANDLE CreateFile( LPCTSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD...
2
by: Craig | last post by:
I've seen many examples of how to call SHGetFileInfo in shell32.dll to get a files associated icon, but I can't find anywhere how to get the file information (size, last date modified, etc, etc)...
5
by: _iycrd | last post by:
After numerous problems, I'm having second thoughts about using C++/CLI to wrap a native DLL. On the other hand, PInvoke seems like it will take a huge amount of work, if it will work at all. ...
8
by: Rajesh Soni | last post by:
Hi! I'm getting a PInvoke error while trying to execute the following code... declaration: Structure POINTAPI Dim x As IntPtr
0
by: Benosham | last post by:
I have been playing around with trying to PInvoke GDI+ from C#, I made recently made the transition from C/C++ to C# and I really like the language, however being the old fashioned programmer I am I...
14
by: Mohamed Mansour | last post by:
Hey there, this will be somewhat a long post, but any response is appreciated! I have done many PInvoke in the past from C++ to C#, but I did PInvoke within C# not C++/CLI. Can someone explain...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

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.