Posted by choomba on 29.1.2009 8:01 | Kommentteja (0)

I’ve been busting my head trying to get Mobile Ink Library’s InkCanvas control to work as expected.

Unfortunately it seems to behave differently than native InkCanvas control. I’m not an native code expert but I’d expect that when using p/invoke I should get same return values as in native code. In native sample code InkCanvas works just as described in MSDN and I get correct return values from functions. But when using managed code InkCanvas behaves differently.

SetAutoExpand function returns 0 as there would be no problems. SetAutoScroll returns 1, which means there was some errors. I have checked LastError and got following errors.

Return values hint of errors:

Error code Explanation
0x06 Invalid handle
0x57 Invalid parameter
0x78 Function not supported

I don’t understand why these errorcodes popup because:

  • Parameters are correct
  • Functions are supported on WM6 which I’m targeting

 

Only if I could get scrollbars to appear.