Technology Questions

Go Back   Technology Questions > Hardware Questions > Mobile Computers > Tablet PC > Tablet PC Software > Tablet PC Developers

Tablet PC Developers Show off your work while discussing with others how to create ink enabled applications.

Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old 05-06-2007, 07:32 AM
Christian Stapfer
Newsgroup Contributor
 
Posts: n/a
Newbie question: How to set InkOverlay.Enabled = false, without throwing any exceptions

Another (quite possibly stupid) question from a newbie:
http://msdn2.microsoft.com/en-us/lib...y.enabled.aspx
tells me how to set Enabled = true for an InkOverlay object.

So far so good. But if I later need to set Enabled=false,
I might cause an InvalidOperationException to be thrown,
because the InkOverlay object "is collecting ink". (I have
seen my code throw such exceptions, when it tried to
simply assign Enabled=false.)

So how am I to set Enabled=false, without causing that kind
of an exception?
I considered testing the CollectingInk property before
trying to assign false to Enabled, however: I do not even
know how to do that correctly, because I cannot just
hardloop until CollectingInk goes to false (my program
freezes when I try to do that).
To me it looks like I am asked to do the impossible
(or at the very least, to do something extremely messy)
in order to set Enabled=false.

But maybe I am overlooking the obvious? Thus my question:
How can I set Enabled = false, without causing any exceptions?

Thanks in advance,
Christian

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

 
Old 05-06-2007, 07:32 AM
  #2 (permalink)  
Old 05-06-2007, 07:32 AM
Josh Einstein
Newsgroup Contributor
 
Posts: n/a
Re: Newbie question: How to set InkOverlay.Enabled = false, without throwing any exceptions

Newbie question? I've been developing Tablet PC applications for like 4
years and I still don't know the answer to that. :)

I run into this problem every now and then and in one circumstance I even
had like 3 people in Microsoft working on that and I still can't say for
sure.

The issue really comes down to WHEN you can set Enabled=false. There seems
to be a few windows messages that while being processed, prohibit the
changing of this property. I honestly don't know enough about InkOverlay to
say more because I usually don't use it. But it is a frustrating problem. It
may be solved in WPF.

--
Josh Einstein (Tablet PC MVP)
Einstein Technologies
Tablet Enhancements for Outlook - Try it free: www.tabletoutlook.com


"Christian Stapfer" <nil@dev.nul> wrote in message
news:75158$462518c7$54482c95$7180@news.hispeed.ch. ..
> Another (quite possibly stupid) question from a newbie:
> http://msdn2.microsoft.com/en-us/lib...y.enabled.aspx
> tells me how to set Enabled = true for an InkOverlay object.
>
> So far so good. But if I later need to set Enabled=false,
> I might cause an InvalidOperationException to be thrown,
> because the InkOverlay object "is collecting ink". (I have
> seen my code throw such exceptions, when it tried to
> simply assign Enabled=false.)
>
> So how am I to set Enabled=false, without causing that kind
> of an exception?
> I considered testing the CollectingInk property before
> trying to assign false to Enabled, however: I do not even
> know how to do that correctly, because I cannot just
> hardloop until CollectingInk goes to false (my program
> freezes when I try to do that).
> To me it looks like I am asked to do the impossible
> (or at the very least, to do something extremely messy)
> in order to set Enabled=false.
>
> But maybe I am overlooking the obvious? Thus my question:
> How can I set Enabled = false, without causing any exceptions?
>
> Thanks in advance,
> Christian
>


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #3 (permalink)  
Old 06-27-2007, 02:40 PM
Scott Sheehan
Newsgroup Contributor
 
Posts: n/a
RE: Newbie question: How to set InkOverlay.Enabled = false, without th

There are a handful of things that you currently can't do without getting a
"busy" exception. (Disabling, setting collection/editing mode, or setting the
input rectangle while the user is inking or gesture recognition is taking
place are the ones I know of). Personally I think it is a bad thing that
these exceptions are thrown, and it would be helpful to know what your use
case is that is causing you to run into these exceptions.

Do you have an InkOverylay that is being disabled from another thread? Are
you trying to recognize complex gestures from this InkOverlay? Something else?


--scott

"Christian Stapfer" wrote:

> Another (quite possibly stupid) question from a newbie:
> http://msdn2.microsoft.com/en-us/lib...y.enabled.aspx
> tells me how to set Enabled = true for an InkOverlay object.
>
> So far so good. But if I later need to set Enabled=false,
> I might cause an InvalidOperationException to be thrown,
> because the InkOverlay object "is collecting ink". (I have
> seen my code throw such exceptions, when it tried to
> simply assign Enabled=false.)
>
> So how am I to set Enabled=false, without causing that kind
> of an exception?
> I considered testing the CollectingInk property before
> trying to assign false to Enabled, however: I do not even
> know how to do that correctly, because I cannot just
> hardloop until CollectingInk goes to false (my program
> freezes when I try to do that).
> To me it looks like I am asked to do the impossible
> (or at the very least, to do something extremely messy)
> in order to set Enabled=false.
>
> But maybe I am overlooking the obvious? Thus my question:
> How can I set Enabled = false, without causing any exceptions?
>
> Thanks in advance,
> Christian
>
>

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #4 (permalink)  
Old 06-27-2007, 09:50 PM
Christian Stapfer
Newsgroup Contributor
 
Posts: n/a
Re: Newbie question: How to set InkOverlay.Enabled = false, without th

Hi,

"Scott Sheehan" <Scott Sheehan@discussions.microsoft.com> wrote in message
news:A429B748-03AF-481D-A214-69A27439B0E1@microsoft.com...
> There are a handful of things that you currently can't do without getting
> a
> "busy" exception. (Disabling, setting collection/editing mode, or setting
> the
> input rectangle while the user is inking or gesture recognition is taking
> place are the ones I know of). Personally I think it is a bad thing that
> these exceptions are thrown, and it would be helpful to know what your use
> case is that is causing you to run into these exceptions.


It's a distributed whiteboard application. The distributed document
(a control) on which inking takes place contains child controls to
which I attach a transparent ink-boundary. That transparent ink-boundary
is just a lazy way of using the existing ink-selection, moving, resizing,
and deletion mechanism for the handling of those child controls as well.
When a child control is created, remote peers need to be informed of
the fact, and they need not only create a local copy of that child
control, they also have to create its transparent ink boundary.
Although the messages that lead to such child-control and ink-boundary
creation are handled by the GUI thread, that does not prevent them
from arriving at times that are completely unrelated to what the local
user happens to be doing with his pen at the moment.
So it seems to be the chance-occurrence of the arrival of certain
messages from remote peers (that require such things as ink-creation,
moving, resizing, and deleting ink, or ink selection changes) that
sometimes leads to "InvalidOperationExceptions" (busy exceptions)
from the InkOverlay object.
But the distributed whiteboard still works reasonably well. Busy
exceptions really do occur only very infrequently. It is even possible,
that I am mistaken about the exact cause: since it is rather difficult
for me to reproduce the sequence of events that leadst to busy
exceptions.
Since I have been advised to move on to implement that whiteboard
using WPF (which I will try to do), I don't feel as paniky as I once did
about those exceptions, since if I can port the whiteboard to WPF
my somewhat hackish transparent-ink-boundary trick can be
dispensed with.

Regards,
Christian

>
> Do you have an InkOverylay that is being disabled from another thread? Are
> you trying to recognize complex gestures from this InkOverlay? Something
> else?
>
>
> --scott
>
> "Christian Stapfer" wrote:
>
>> Another (quite possibly stupid) question from a newbie:
>> http://msdn2.microsoft.com/en-us/lib...y.enabled.aspx
>> tells me how to set Enabled = true for an InkOverlay object.
>>
>> So far so good. But if I later need to set Enabled=false,
>> I might cause an InvalidOperationException to be thrown,
>> because the InkOverlay object "is collecting ink". (I have
>> seen my code throw such exceptions, when it tried to
>> simply assign Enabled=false.)
>>
>> So how am I to set Enabled=false, without causing that kind
>> of an exception?
>> I considered testing the CollectingInk property before
>> trying to assign false to Enabled, however: I do not even
>> know how to do that correctly, because I cannot just
>> hardloop until CollectingInk goes to false (my program
>> freezes when I try to do that).
>> To me it looks like I am asked to do the impossible
>> (or at the very least, to do something extremely messy)
>> in order to set Enabled=false.
>>
>> But maybe I am overlooking the obvious? Thus my question:
>> How can I set Enabled = false, without causing any exceptions?
>>
>> Thanks in advance,
>> Christian
>>
>>


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Newbie Question GM Windows XP Tablet PC Newsgroup 2 06-05-2008 02:30 PM
Newbie question .... temp2@cfl.rr.com Linux 9 05-06-2007 12:23 AM
Newbie Question Mike Smartphones 1 01-24-2007 02:30 PM
newbie question Jef Delcroix Smartphones 1 01-05-2007 05:19 AM
Question on Spyware Doctor scan results - false positives in HOSTS file? mishelle10878@nohayoo.com Windows XP 4 01-04-2007 02:22 AM


New To Technology Questions? Do You Need Help with Your Computer or Device? Do You Need Help with this site?

All times are GMT -8. The time now is 08:24 PM.


2003 - 2009 All Rights Reserved. Technology Questions

Search Engine Friendly URLs by vBSEO 3.3.0