Click here to Skip to main content
14,695,615 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I have some C++ code, which gets control of a digital notepad. The pen of the notepad uses the mouse's driver by default. I want to separate the pen from the mouse.

Ok. Firstly, I have all the code already and it's working. My problem is it is in C++ and the logic is integrated with the UI. Having absolutely no prior C++ experience or exposure, I set about separating the logic from the UI, so that I can call DllImport from my C# application.

I have successfully managed to get control of the pen (separate from mouse move and click). Now there is a GetData method, which just has to get the positioning of the pen in relation to the notepad. When I call the DeviceIoControl method in there, the GetLastError() is always 55, ERROR_DEV_NOT_EXIST. Strangely enough though, is that if I call DeviceIoControl with the IOCTL code to get the driver version, it is successful?

How would I go about finding out what my problem is?
Any help would be appreciated,
Niels
Posted
Updated 17-Jun-10 23:46pm
v3

I think this is due to the different calling conventions. Have a look at this link:

http://msdn.microsoft.com/en-us/magazine/cc164123.aspx[^]

Good luck!
   
Hi,

thanks for the response, I forgot about this post. My problem was solved when I passed the IntPtr Handle from my C# app to C++ and use that handle.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900