Group:  Other Microsoft Office Products ยป microsoft.public.onenote
Thread: OneNote 2007 API - Data within InkWords Not loadable by MS Ink class

Geek News

OneNote 2007 API - Data within InkWords Not loadable by MS Ink class
"benmca[ at ]gmail.com" <benmca[ at ]gmail.com> 6/20/2007 4:42:24 PM
Hi -

I'm trying to query for ink in a certain region of a page within
OneNote. My query works ok, and I end up iterating through InkWords,
gathering ink as I go. My strategy was to build a primary Ink object,
adding ink from each InkWord to it as I go. Some pseudocode:

XmlNodeList dataNodes = parentNode.SelectNodes("//one:Data", xmlns);
Ink ink = new Ink();
foreach(XmlNode node in dataNodes)
{
string encodedInk = node.InnerText;
Ink tempInk = DecodeInk(encodedInk);
primaryInk.AddStrokesAtRectangle(s, r);
}

Within Decode Ink, I do the following:

Ink ink = new Ink();
ink.Load(Convert.FromBase64String(encodedInk));
return ink;

The problem is this: When I call Ink.Load, the ink object throws an
exception:

Catastrophic failure (Exception from HRESULT: 0x8000FFFF
(E_UNEXPECTED))

As far as I know, this only happens when the ink is in a format which
the Ink object does not understand. I tried changing my ink.Load call
to
ink.Load("base64:" + Convert.FromBase64String(encodedInk));
....but got the same result.

Is the Ink for an InkDrawing encoded differently after IA (conversion
to InkWord)? I noticed a difference in the data, but assumed it was
normalizing strokes or something, no re-encoding data. Thanks for any
help!

Ben

Re: OneNote 2007 API - Data within InkWords Not loadable by MS Ink class
Ilya Koulchin <ikoulchine[ at ]hotmail.com> 6/21/2007 9:00:15 PM
Does this happen for all InkWords, or just some of them? Could you post
the ISF for some of the ink that fails to load?
Also, what version of the framework are you using?

Ilya
Re: OneNote 2007 API - Data within InkWords Not loadable by MS Ink class
"Daniel Escapa [MS]" <not_real[ at ]microsoft.com> 6/25/2007 11:49:24 PM
Yes please send us the ISF...I will work with you offline.


<benmca[ at ]gmail.com> wrote in message
news:1182357744.190740.227640[ at ]o11g2000prd.googlegroups.com...
[Quoted Text]
> Hi -
>
> I'm trying to query for ink in a certain region of a page within
> OneNote. My query works ok, and I end up iterating through InkWords,
> gathering ink as I go. My strategy was to build a primary Ink object,
> adding ink from each InkWord to it as I go. Some pseudocode:
>
> XmlNodeList dataNodes = parentNode.SelectNodes("//one:Data", xmlns);
> Ink ink = new Ink();
> foreach(XmlNode node in dataNodes)
> {
> string encodedInk = node.InnerText;
> Ink tempInk = DecodeInk(encodedInk);
> primaryInk.AddStrokesAtRectangle(s, r);
> }
>
> Within Decode Ink, I do the following:
>
> Ink ink = new Ink();
> ink.Load(Convert.FromBase64String(encodedInk));
> return ink;
>
> The problem is this: When I call Ink.Load, the ink object throws an
> exception:
>
> Catastrophic failure (Exception from HRESULT: 0x8000FFFF
> (E_UNEXPECTED))
>
> As far as I know, this only happens when the ink is in a format which
> the Ink object does not understand. I tried changing my ink.Load call
> to
> ink.Load("base64:" + Convert.FromBase64String(encodedInk));
> ...but got the same result.
>
> Is the Ink for an InkDrawing encoded differently after IA (conversion
> to InkWord)? I noticed a difference in the data, but assumed it was
> normalizing strokes or something, no re-encoding data. Thanks for any
> help!
>
> Ben
>

Re: OneNote 2007 API - Data within InkWords Not loadable by MS Ink class
"benmca[ at ]gmail.com" <benmca[ at ]gmail.com> 6/27/2007 9:56:09 PM
It was an issue in my code - A bad xpath query led to erroneously
trying to load data from an image instead of InkWord etc. I'll post
again once I get to the InkWord loading. Thanks for the support
guys!

b

On Jun 25, 4:49 pm, "Daniel Escapa [MS]" <not_r...[ at ]microsoft.com>
wrote:
[Quoted Text]
> Yes please send us the ISF...I will work with you offline.
>
> <ben...[ at ]gmail.com> wrote in message
>
> news:1182357744.190740.227640[ at ]o11g2000prd.googlegroups.com...
>
> > Hi -
>
> > I'm trying to query for ink in a certain region of a page within
> > OneNote. My query works ok, and I end up iterating through InkWords,
> > gathering ink as I go. My strategy was to build a primary Ink object,
> > adding ink from each InkWord to it as I go. Some pseudocode:
>
> > XmlNodeList dataNodes = parentNode.SelectNodes("//one:Data", xmlns);
> > Ink ink = new Ink();
> > foreach(XmlNode node in dataNodes)
> > {
> > string encodedInk = node.InnerText;
> > Ink tempInk = DecodeInk(encodedInk);
> > primaryInk.AddStrokesAtRectangle(s, r);
> > }
>
> > Within Decode Ink, I do the following:
>
> > Ink ink = new Ink();
> > ink.Load(Convert.FromBase64String(encodedInk));
> > return ink;
>
> > The problem is this: When I call Ink.Load, the ink object throws an
> > exception:
>
> > Catastrophic failure (Exception from HRESULT: 0x8000FFFF
> > (E_UNEXPECTED))
>
> > As far as I know, this only happens when the ink is in a format which
> > the Ink object does not understand. I tried changing my ink.Load call
> > to
> > ink.Load("base64:" + Convert.FromBase64String(encodedInk));
> > ...but got the same result.
>
> > Is the Ink for an InkDrawing encoded differently after IA (conversion
> > to InkWord)? I noticed a difference in the data, but assumed it was
> > normalizing strokes or something, no re-encoding data. Thanks for any
> > help!
>
> > Ben



Re: OneNote 2007 API - Data within InkWords Not loadable by MS Ink class
"Daniel Escapa [MS]" <not_real[ at ]microsoft.com> 6/29/2007 10:35:59 PM
Not a problem and please let us know what you are working on!


<benmca[ at ]gmail.com> wrote in message
news:1182981369.696024.163080[ at ]d30g2000prg.googlegroups.com...
[Quoted Text]
> It was an issue in my code - A bad xpath query led to erroneously
> trying to load data from an image instead of InkWord etc. I'll post
> again once I get to the InkWord loading. Thanks for the support
> guys!
>
> b
>
> On Jun 25, 4:49 pm, "Daniel Escapa [MS]" <not_r...[ at ]microsoft.com>
> wrote:
>> Yes please send us the ISF...I will work with you offline.
>>
>> <ben...[ at ]gmail.com> wrote in message
>>
>> news:1182357744.190740.227640[ at ]o11g2000prd.googlegroups.com...
>>
>> > Hi -
>>
>> > I'm trying to query for ink in a certain region of a page within
>> > OneNote. My query works ok, and I end up iterating through InkWords,
>> > gathering ink as I go. My strategy was to build a primary Ink object,
>> > adding ink from each InkWord to it as I go. Some pseudocode:
>>
>> > XmlNodeList dataNodes = parentNode.SelectNodes("//one:Data", xmlns);
>> > Ink ink = new Ink();
>> > foreach(XmlNode node in dataNodes)
>> > {
>> > string encodedInk = node.InnerText;
>> > Ink tempInk = DecodeInk(encodedInk);
>> > primaryInk.AddStrokesAtRectangle(s, r);
>> > }
>>
>> > Within Decode Ink, I do the following:
>>
>> > Ink ink = new Ink();
>> > ink.Load(Convert.FromBase64String(encodedInk));
>> > return ink;
>>
>> > The problem is this: When I call Ink.Load, the ink object throws an
>> > exception:
>>
>> > Catastrophic failure (Exception from HRESULT: 0x8000FFFF
>> > (E_UNEXPECTED))
>>
>> > As far as I know, this only happens when the ink is in a format which
>> > the Ink object does not understand. I tried changing my ink.Load call
>> > to
>> > ink.Load("base64:" + Convert.FromBase64String(encodedInk));
>> > ...but got the same result.
>>
>> > Is the Ink for an InkDrawing encoded differently after IA (conversion
>> > to InkWord)? I noticed a difference in the data, but assumed it was
>> > normalizing strokes or something, no re-encoding data. Thanks for any
>> > help!
>>
>> > Ben
>
>
>

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net