InkCanvas exception  
Author Message
Jonathan Brown





PostPosted: Notebook, Tablet PC, and UMPC Development, InkCanvas exception Top

Help!

I am using .NET 3.0 Beta 2 and VS2005 on Windows XP Tablet PC 2005 edition.

Whenever I try and use the <InkCanvas> element I get an unhandled NotSupportedException as soon as the mouse/pen is moved into the ink canvas area. Full details of xaml used and exception below. The exception occurs in the app.Run method.

<Grid><InkCanvas /></Grid>

System.NotSupportedException was unhandled
Message="DLL version not correct."
Source="PresentationCore"
StackTrace:
at MS.Internal.HRESULT.Check(Int32 hr)
at System.Windows.Media.FactoryMaker.get_ImagingFactoryPtr()
at System.Windows.Media.Imaging.FormatConvertedBitmap.FinalizeCreation()
at System.Windows.Media.Imaging.FormatConvertedBitmap.EndInit()
at MS.Internal.Ink.PenCursorManager.GetPixels(RenderTargetBitmap rtb, Int32 width, Int32 height)
at MS.Internal.Ink.PenCursorManager.CreateCursorFromDrawing(Drawing drawing, Point hotspot)
at MS.Internal.Ink.PenCursorManager.GetPenCursor(DrawingAttributes drawingAttributes, Boolean isHollow)
at MS.Internal.Ink.InkCollectionBehavior.GetCurrentCursor()
at MS.Internal.Ink.EditingBehavior.get_Cursor()
at MS.Internal.Ink.EditingCoordinator.GetActiveBehaviorCursor()
at System.Windows.Controls.InkCanvas._OnQueryCursor(Object sender, QueryCursorEventArgs e)
at System.Windows.Input.QueryCursorEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.MouseDevice.UpdateCursorPrivate()
at System.Windows.Input.MouseDevice.PostProcessInput(Object sender, ProcessInputEventArgs e)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.StylusLogic.SendDeferredMouseEvent(Boolean sendInput)
at System.Windows.Input.StylusLogic.PreProcessInput(Object sender, PreProcessInputEventArgs e)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.Run()
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at System.Windows.Application.Run()
at TheFirstOne.App.Main() in D:\Teletrak\Research and Development\NET 3.0 Beta 2\TheFirstOne\TheFirstOne\obj\Debug\App.g.vb:line 53
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()



Software Development for Windows Vista17  
 
 
Stefan Wick - MSFT





PostPosted: Notebook, Tablet PC, and UMPC Development, InkCanvas exception Top

Hi Jonathan,

this looks like a configuration/setup issue. I have seen this problem on machines that had a version mismatch between milcore.dll and PresentationCore.dll.

Did you have earlier versions of Windows Presentation Foundation on that machine What version number do those two DLLs have on your system

Thanks,

Stefan Wick



 
 
Jonathan Brown





PostPosted: Notebook, Tablet PC, and UMPC Development, InkCanvas exception Top

Hi Stefan

Yes I did have an earlier version of WPF on the machine, the January CTP. I did remove it prior to installing the new Beta version.

The version numbers are:-

milcore.dll - V6.0.5378.0 (located in \windows\system32)

PresentationCore.dll - V3.0.6327.0 (located in \Program Files\Reference Assemblies\Microsoft\WinFx\V3.0)

Regards

Jonathan


 
 
Stefan Wick - MSFT





PostPosted: Notebook, Tablet PC, and UMPC Development, InkCanvas exception Top

Looks like your milcore.dll is old.

Did you follow the instructions from this web site before installing the Beta2 build

http://www.microsoft.com/downloads/details.aspx FamilyId=AAE7FC63-D405-4E13-909F-E85AA9E66146&displaylang=en

Thanks, Stefan Wick



 
 
Jonathan Brown





PostPosted: Notebook, Tablet PC, and UMPC Development, InkCanvas exception Top

Hi Stefan

Prior to installing Beta 2, I uninstalled (via Add/Remove Programs) the Jan CTP versions of the WinFx runtime, the Windows SDK, and the Visual Studio ORCAS tools.

I then installed the equivalent Beta 2 versions of the above.

No errors or problems occurred during either the uninstall or the install.

Another observation - the milcore.dll and PresentationCore.dll both have identical creation/last modified dates, being 27th April 2006 - this implies that milcore.dll must have been installed during Beta 2 setup.

What is the correct version number of milcore.dll

Regards

Jonathan


 
 
Stefan Wick - MSFT





PostPosted: Notebook, Tablet PC, and UMPC Development, InkCanvas exception Top

Hi Jonathan,

on my Beta2 Vista machine milcore.dll has version 5384.4. But I think the version you have is actually the correct Beta2 version for XP. So I suspect there must be another component that is causing the mismatch. What's your version of WindowsCodecs.dll

Could you try re-installing after running the uninstall tool from the link in my previous post

Thanks, Stefan Wick



 
 
csammis





PostPosted: Notebook, Tablet PC, and UMPC Development, InkCanvas exception Top

Stefan - some of my users have been seeing problems with DLL Version Not Correct, perhaps it is related

http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=507038&SiteID=1

 
 
Stefan Wick - MSFT





PostPosted: Notebook, Tablet PC, and UMPC Development, InkCanvas exception Top

Yes, this appears to be the same issue.

Apparently, there were incorrect bits posted on the Beta2 download site for a couple of days. Here's a post that shows the steps to resolve this: http://blogs.msdn.com/rwlodarc/archive/2006/05/25/607131.aspx

This should also fix the InkCanvas problem that Jonathan reported in this thread.

Thanks, Stefan Wick



 
 
Jonathan Brown





PostPosted: Notebook, Tablet PC, and UMPC Development, InkCanvas exception Top

Hi Stefan

I have just followed the steps from your previous post, but alas, it has not resolved the issue.

Regards

Jonathan


 
 
Stefan Wick - MSFT





PostPosted: Notebook, Tablet PC, and UMPC Development, InkCanvas exception Top

Can you check the version number of your WindowsCodecs.dll

Thanks, Stefan Wick



 
 
Jonathan Brown





PostPosted: Notebook, Tablet PC, and UMPC Development, InkCanvas exception Top

Hi Stefan

My WindowsCodecs.dll version is 6.0.5448.0 and it has a last modified date 4th June 06.

Regards

Jonathan


 
 
Stefan Wick - MSFT





PostPosted: Notebook, Tablet PC, and UMPC Development, InkCanvas exception Top

Hi Jonathan,

Looks like you have the June CTP WIC bits on your system (symptom: windowscodecs.dll is version 6.0.5448). You will need to uninstall WIC then re-install the correct (beta 2) WIC.


To do that uninstall WIC by running %windir%\$NtUninstallWIC$\spuninst\spuninst.exe (verify that windowscodes.dll has been removed). Then re-install the beta 2 WIC from here: http://go.microsoft.com/fwlink/ LinkId=62438&clcid=0x409

Thanks, Stefan Wick



 
 
Jonathan Brown





PostPosted: Notebook, Tablet PC, and UMPC Development, InkCanvas exception Top

Hi Stefan

That has fixed the problem. Thank you for your perseverance in resolving this issue.

An obversation though:-

When I reinstalled the WinFx Beta 2.0 Runtime the other day (as suggested by one of your earlier posts above) I was very careful to make sure that I downloaded the Beta 2 version, rather than the June CTP version. Prior to downloading I deleted the previous downloads setup temporary files etc to make absolutely sure that I downloaded the latest version from the MSDN web site. It appears that the web site link actually downloads the June CTP (or at least the WIC components)!

Anyway, thanks.

Regards

Jonathan

 

 

 

 

 


 
 
csammis





PostPosted: Notebook, Tablet PC, and UMPC Development, InkCanvas exception Top

As was stated by Ashish in the thread I posted (http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=507038&SiteID=1), there were indeed some "crossed wires" that have been resolved.

 
 
Stefan Wick - MSFT





PostPosted: Notebook, Tablet PC, and UMPC Development, InkCanvas exception Top

Glad to hear it's working now.

Your observation is correct: you did all the right steps to install Beta2, but there was a bad mixup on the download server so that people got the wrong WIC bits.

Sorry for the inconvenient download/install experience. We'll make sure this won't happen again.

Now have fun using our InkCanvas. Please let me know if you have any questions - or if you run into any problems.

Thanks, Stefan Wick