General questions

Answered

Using package.Save() Method

I am developing a c# UWP application that uses the iink SDK to allow for math input. I am trying to use the package.Save() method however when the method is called I get an unspecified error "INVALID ARGUMENT" even though it appears that the method takes no arguments. Am I using this method wrong?

Michael


Best Answer

Dear Michael,


We reproduced your issue and indeed you try to write at a location where do do not have the rights.

Your "_packageName" should be generated like in the GetStarted example:


private static string MakeUntitledFilename()
{
    var localFolder = Windows.Storage.ApplicationData.Current.LocalFolder.Path;
    var num = 0;
    string name;

    do
    {
        var baseName = "File" + (++num) + ".iink";
        name = System.IO.Path.Combine(localFolder, baseName);
    }
    while (System.IO.File.Exists(name));

     return name;
}


It contains the concatenation of the localFolder path and the fileName.


Regards,


Maël


Dear Michael,


When you create a content package you have to provide a name.

That name will be used as file name so if the name provided is weird, you may get an error.


You can look at this page for an example : https://developer.myscript.com/docs/interactive-ink/1.2/windows/fundamentals/storage/#back-to-the-example


Regards,


Maël

Hi Maël,

The code I use to set the package name is     private string _packageName = "MathBox" + MainPage.mathBoxCount + ".iink";    which is almost the same as the example.

Is it the case that numbers cannot be used in the name or could I be doing something else wrong?

Thanks

Michael


Dear Michael,


You try to write somewhere else than the local folder.

You may not have the proper permission.


Regards,


Maël

Hi Maël,

The code I use to save the package is (with gifName being a string the user enters):

                Windows.Storage.StorageFolder storageFolder = Windows.Storage.ApplicationData.Current.LocalFolder;

                Windows.Storage.StorageFolder newFolder = await storageFolder.CreateFolderAsync(gifName, Windows.Storage.CreationCollisionOption.ReplaceExisting);

                Windows.Storage.StorageFolder iink = await newFolder.CreateFolderAsync(gifName + "iink", Windows.Storage.CreationCollisionOption.ReplaceExisting);

foreach(MathBox box in FindVisualChildren<MathBox>(NotesArea))

                {

                    box.SaveContent(iink);

                }


Then in the MathBox class which implements the SDK:

 public void SaveContent(StorageFolder folder)

        {

            SaveHistory();

            _package.Save();

 

        }

This uses the same package name as above, and saves it to a new folder inside the local folder which I therefore have permission to access.

I can't see anywhere that I am going wrong, other than perhaps only being able to save directly inside the local folder, is this the case?

Thanks

Michael

Dear Michael,


Maybe you did not define a temp folder and that's trigger the issue ?

Here is an example : https://github.com/MyScript/interactive-ink-examples-uwp/blob/master/Demo/MainPage.xaml.cs#L76


Regards,


Maël

Hi Maël,

I do set a temporary folder as per the example you linked. This is all the code that implements the SDK and almost all of it comes from the tutorial on the website.


public MathBox()

        {

            this.InitializeComponent();

            _engine = Engine.Create((byte[])(Array)MyScript.Certificate.MyCertificate.Bytes);

            // Get the configuration object

            var configuration = _engine.Configuration;

 

            // Set the recognition resources path

            string[] folders = new string[1];

            folders[0] = "conf";

            configuration.SetStringArray("configuration-manager.search-path", folders);

            configuration.SetString("lang", "en_US");

 

 

            // Set the temporary directory

            var localFolder = Windows.Storage.ApplicationData.Current.LocalFolder.Path;

            var tempFolder = System.IO.Path.Combine(localFolder.ToString(), "tmp");

            configuration.SetString("content-package.temp-folder", tempFolder);

 

            // Set the math fractional part precision

            editor.Engine = _engine;

            OpenContent();

        }

 

        private ContentPart _part;

        private ContentPackage _package;

        private string _packageName = "MathBox" + MainPage.mathBoxCount + ".iink";

 

        public void SaveContent(StorageFolder folder)

        {

            SaveHistory();

            _package.Save();

 

        }

 

 

        public void OpenSaved(StorageFile file)

        {

            _package = _engine.OpenPackage(file.Name);

            _part = _package.GetPart(0);

            // Load history from part metadata

            LoadHistory();

        }

 

        public void OpenContent()

        {

            if (System.IO.File.Exists(_packageName))

            {

                _package = _engine.OpenPackage(_packageName);

                _part = _package.GetPart(0);

                // Load history from part metadata

                LoadHistory();

            }

            else

            {

                // Create a content package to provide the SDK with a place to work

                _package = _engine.CreatePackage(_packageName);

                // Create a Math part

                _part = _package.CreatePart("Math");

            }

            editor.Editor.Part = _part;

        }

 

        private List<string> history = new List<string>();

 

        void LoadHistory()

        {

            var parameterSet = _part.Metadata;

            history = parameterSet.GetStringArray("history").ToList();

        }

 

        void SaveHistory()

        {

            var parameterSet = editor.Editor.Part.Metadata;

            parameterSet.SetStringArray("history", history.ToArray());

            editor.Editor.Part.Metadata = parameterSet;

        }

 

        private void Undo(object sender, RoutedEventArgs e)

        {

            editor.Editor.Undo();

        }

 

        private void Redo(object sender, RoutedEventArgs e)

        {

            editor.Editor.Redo();

        }

 

        public void Clear()

        {

            editor.Editor.Clear();

        }

 

        private void recognize_Click(object sender, RoutedEventArgs e)

        {

            editor.Editor.Convert(editor.Editor.GetRootBlock(), ConversionState.DIGITAL_EDIT);

            var latexStr = editor.Editor.Export_(editor.Editor.GetRootBlock(), MimeType.LATEX);

            if (!String.IsNullOrEmpty(latexStr) && (history.Count == 0 || history.Last() != latexStr))

                history.Add(latexStr);

            SaveHistory();

        }

Is there anything you can see here that could cause the issue that I'm having?

Thanks

Michael

Dear Michael,


It seems you does not specify the destination directory when you call 

_editor.OpenPackage


The file will be stored in the current directory.

Can you please try with 

 _package = _engine.OpenPackage(Windows.Storage.ApplicationData.Current.LocalFolder.Path + _packageName);


Regards,


Maël

Hi Maël,

This doesn't seem to help. When I add one of these maths elements the package is created as new and so the package is created newly. Then when this package is saved for the first time, this is when I get the error.

I can see the package data in the tmp file while the app is running but as soon as the save function is run it crashes with this error.

Thanks

Michael 

Dear Michael,


To better understand what is going on can you provide us debug log ?

You need to add the following right after the temp folder creation settings:


var localFolder = Windows.Storage.ApplicationData.Current.LocalFolder.Path;
engine.Configuration.SetString("debug.log-file", System.IO.Path.Combine(localFolder, "log.txt"));


It will provide in details all the calls performed.


Regards,


Maël

Hi Maël,

I have done this and below is the code which I used to save the package which you saw before, followed by the contents of the log file.

Thanks 

Michael

 

The code:

private void Save_Click(object sender, RoutedEventArgs e)
        {
            this.SaveContent(Windows.Storage.ApplicationData.Current.LocalFolder);
        }

        public void SaveContent(StorageFolder folder)
        {
            SaveHistory();
            _package.Save();
        }

The log file:




----------------------------



Engine::createRenderer (132, 132.8, renderer provider)

Renderer::addListener start

Renderer::addListener end

Engine::createEditor (renderer provider)

Editor::Editor

Editor::setViewSize start (0, 0)

Editor::setViewSize end

Editor::setFontMetricsProvider start

Editor::setFontMetricsProvider end

Editor::addListener

Engine::openPackage start ("MathBox0.iink") (2)

EXCEPTION class std::runtime_error "a package associated with the filename "MathBox0.iink" already exists"




----------------------------



Engine::createRenderer (132, 132.8, renderer provider)

Renderer::addListener start

Renderer::addListener end

Engine::createEditor (renderer provider)

Editor::Editor

Editor::setViewSize start (0, 0)

Editor::setViewSize end

Editor::setFontMetricsProvider start

Editor::setFontMetricsProvider end

Editor::addListener

Engine::openPackage start ("MathBox0.iink") (2)

Engine::openPackage end

ContentPackage::createPart start ("Math")

Engine::getSupportedPartTypes

ContentPart::ContentPart ("Math")

ContentPackage::createPart end

Editor::setPart start ("ouywwbao")

Editor::configure start

Renderer::addListener start

Renderer::addListener end

Editor::configure end

IEditorListener::partChanged start

IEditorListener::partChanged end

Editor::setPart end

Editor::setViewSize start (795, 255)

Editor::setViewSize end

Renderer::drawCaptureStrokes start (0, 0, 796, 256)

Renderer::drawCaptureStrokes end

Renderer::drawTemporaryItems start (0, 0, 796, 256)

Renderer::drawTemporaryItems end

Renderer::drawModel start (0, 0, 796, 256)

Renderer::drawModel end

Renderer::drawBackground start (0, 0, 796, 256)

Renderer::drawBackground end

Editor::pointerDown (181.581, 49.5874, 75488769, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (176, 44, 12, 12)

Renderer::drawCaptureStrokes end

Editor::pointerMove (181.581, 59.1874, 75488809, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (176, 44, 12, 21)

Renderer::drawCaptureStrokes end

Editor::pointerMove (182.375, 63.9874, 75488817, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (176, 44, 12, 25)

Renderer::drawCaptureStrokes end

Editor::pointerMove (182.375, 68.7874, 75488825, 0.5, 0, 1, 0)

Editor::pointerMove (183.169, 75.9685, 75488833, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (176, 44, 13, 37)

Renderer::drawCaptureStrokes end

Editor::pointerMove (184.794, 81.6, 75488841, 0.5, 0, 1, 0)

Editor::pointerMove (185.587, 88.7811, 75488849, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (176, 54, 16, 41)

Renderer::drawCaptureStrokes end

Editor::pointerMove (186.381, 96.7937, 75488857, 0.5, 0, 1, 0)

Editor::pointerMove (186.381, 103.975, 75488865, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (176, 63, 17, 46)

Renderer::drawCaptureStrokes end

Editor::pointerMove (188.8, 115.2, 75488873, 0.5, 0, 1, 0)

Editor::pointerMove (189.594, 127.975, 75488881, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (179, 76, 17, 57)

Renderer::drawCaptureStrokes end

Editor::pointerMove (190.387, 135.987, 75488890, 0.5, 0, 1, 0)

Editor::pointerMove (191.181, 144.794, 75488897, 0.5, 0, 1, 0)

Editor::pointerMove (192.769, 155.981, 75488905, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (180, 91, 19, 70)

Renderer::drawCaptureStrokes end

Editor::pointerMove (192.769, 160.781, 75488913, 0.5, 0, 1, 0)

Editor::pointerMove (193.6, 163.994, 75488921, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (184, 123, 16, 46)

Renderer::drawCaptureStrokes end

Editor::pointerMove (193.6, 167.169, 75488929, 0.5, 0, 1, 0)

Editor::pointerMove (193.6, 168, 75488937, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (186, 139, 14, 34)

Renderer::drawCaptureStrokes end

Editor::pointerMove (193.6, 167.169, 75489033, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (187, 155, 13, 18)

Renderer::drawCaptureStrokes end

Editor::pointerMove (193.6, 165.581, 75489041, 0.5, 0, 1, 0)

Editor::pointerUp (193.6, 165.581, 75489041, 0.5, 0, 1)

Renderer::drawCaptureStrokes start (188, 159, 12, 14)

Renderer::drawCaptureStrokes end

IEditorListener::contentChanged start (1 blocks)

IEditorListener::contentChanged MainBlock

IEditorListener::contentChanged end

Renderer::drawModel start (176, 44, 24, 131)

Renderer::drawModel end

Renderer::drawCaptureStrokes start (178, 46, 19, 126)

Renderer::drawCaptureStrokes end

Editor::pointerDown (278.375, 58.3937, 75490352, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (272, 52, 12, 12)

Renderer::drawCaptureStrokes end

Editor::pointerMove (278.375, 59.9811, 75490383, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (272, 52, 12, 13)

Renderer::drawCaptureStrokes end

Editor::pointerMove (278.375, 61.5685, 75490391, 0.5, 0, 1, 0)

Editor::pointerMove (278.375, 64.7811, 75490399, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (272, 52, 12, 19)

Renderer::drawCaptureStrokes end

Editor::pointerMove (278.375, 67.9937, 75490407, 0.5, 0, 1, 0)

Editor::pointerMove (279.169, 69.5811, 75490415, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (272, 52, 13, 24)

Renderer::drawCaptureStrokes end

Editor::pointerMove (279.169, 72.7937, 75490423, 0.5, 0, 1, 0)

Editor::pointerMove (280.794, 81.6, 75490431, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (272, 56, 15, 32)

Renderer::drawCaptureStrokes end

Editor::pointerMove (282.381, 91.2, 75490439, 0.5, 0, 1, 0)

Editor::pointerMove (283.175, 100.8, 75490447, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (272, 63, 17, 44)

Renderer::drawCaptureStrokes end

Editor::pointerMove (284.8, 115.2, 75490456, 0.5, 0, 1, 0)

Editor::pointerMove (285.594, 129.6, 75490463, 0.5, 0, 1, 0)

Editor::pointerMove (286.387, 139.2, 75490471, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (274, 67, 18, 78)

Renderer::drawCaptureStrokes end

Editor::pointerMove (287.181, 147.969, 75490479, 0.5, 0, 1, 0)

Editor::pointerMove (288.768, 159.194, 75490487, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (278, 95, 17, 70)

Renderer::drawCaptureStrokes end

Editor::pointerMove (289.6, 163.994, 75490495, 0.5, 0, 1, 0)

Editor::pointerMove (289.6, 168, 75490505, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (280, 124, 16, 49)

Renderer::drawCaptureStrokes end

Editor::pointerMove (289.6, 171.175, 75490511, 0.5, 0, 1, 0)

Editor::pointerMove (289.6, 171.969, 75490519, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (282, 143, 14, 34)

Renderer::drawCaptureStrokes end

Editor::pointerMove (289.6, 171.175, 75490578, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (284, 159, 12, 18)

Renderer::drawCaptureStrokes end

Editor::pointerMove (289.6, 170.381, 75490585, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (284, 163, 12, 14)

Renderer::drawCaptureStrokes end

Editor::pointerMove (289.6, 168.794, 75490593, 0.5, 0, 1, 0)

Editor::pointerMove (289.6, 166.375, 75490602, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (284, 160, 12, 17)

Renderer::drawCaptureStrokes end

Editor::pointerMove (289.6, 164.787, 75490609, 0.5, 0, 1, 0)

Editor::pointerMove (289.6, 163.2, 75490618, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (284, 158, 12, 19)

Renderer::drawCaptureStrokes end

Editor::pointerMove (289.6, 162.368, 75490625, 0.5, 0, 1, 0)

Editor::pointerUp (289.6, 162.368, 75490625, 0.5, 0, 1)

Renderer::drawCaptureStrokes start (284, 156, 12, 19)

Renderer::drawCaptureStrokes end

IEditorListener::contentChanged start (1 blocks)

IEditorListener::contentChanged MainBlock

IEditorListener::contentChanged end

Renderer::drawModel start (272, 52, 24, 127)

Renderer::drawModel end

Renderer::drawCaptureStrokes start (275, 55, 18, 122)

Renderer::drawCaptureStrokes end

Editor::pointerDown (451.175, 63.9874, 75491644, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (446, 59, 11, 10)

Renderer::drawCaptureStrokes end

Editor::pointerMove (451.175, 65.5748, 75491651, 0.5, 0, 1, 0)

Editor::pointerMove (451.175, 69.5811, 75491659, 0.5, 0, 1, 0)

Editor::pointerMove (451.175, 72.7937, 75491667, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (446, 59, 11, 20)

Renderer::drawCaptureStrokes end

Editor::pointerMove (450.381, 75.9685, 75491675, 0.5, 0, 1, 0)

Editor::pointerMove (450.381, 79.9748, 75491683, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (444, 59, 13, 26)

Renderer::drawCaptureStrokes end

Editor::pointerMove (450.381, 83.9811, 75491691, 0.5, 0, 1, 0)

Editor::pointerMove (448.794, 88.7811, 75491699, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (443, 64, 14, 31)

Renderer::drawCaptureStrokes end

Editor::pointerMove (448.794, 95.1685, 75491707, 0.5, 0, 1, 0)

Editor::pointerMove (448.794, 101.594, 75491717, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (443, 71, 14, 37)

Renderer::drawCaptureStrokes end

Editor::pointerMove (448, 108.775, 75491725, 0.5, 0, 1, 0)

Editor::pointerMove (448, 116.787, 75491733, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (443, 79, 14, 44)

Renderer::drawCaptureStrokes end

Editor::pointerMove (448, 125.594, 75491741, 0.5, 0, 1, 0)

Editor::pointerMove (448, 135.194, 75491749, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (443, 90, 12, 51)

Renderer::drawCaptureStrokes end

Editor::pointerMove (447.169, 143.169, 75491757, 0.5, 0, 1, 0)

Editor::pointerMove (447.169, 151.181, 75491765, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (442, 103, 11, 54)

Renderer::drawCaptureStrokes end

Editor::pointerMove (447.169, 157.569, 75491773, 0.5, 0, 1, 0)

Editor::pointerMove (447.169, 164.787, 75491781, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (442, 120, 11, 51)

Renderer::drawCaptureStrokes end

Editor::pointerMove (447.169, 169.587, 75491790, 0.5, 0, 1, 0)

Editor::pointerMove (447.169, 172.8, 75491797, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (442, 138, 11, 41)

Renderer::drawCaptureStrokes end

Editor::pointerMove (447.169, 175.181, 75491805, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (442, 152, 11, 29)

Renderer::drawCaptureStrokes end

Editor::pointerUp (447.169, 175.181, 75491981, 0.5, 0, 1)

Renderer::drawCaptureStrokes start (442, 159, 11, 22)

Renderer::drawCaptureStrokes end

IEditorListener::contentChanged start (1 blocks)

IEditorListener::contentChanged MainBlock

IEditorListener::contentChanged end

Renderer::drawModel start (440, 58, 17, 123)

Renderer::drawModel end

Renderer::drawCaptureStrokes start (443, 60, 13, 120)

Renderer::drawCaptureStrokes end

ContentPart::getMetadata start

ContentPart::getMetadata end

ContentPart::setMetadata start

ContentPart::setMetadata end

ContentPackage::save start

EXCEPTION class std::runtime_error "INVALID_ARGUMENT"


 




Hi Maël,

At the start of the log file there is an error about MathBox0 package already existing. This was from a previous run of the program where I had forgotten to empty the local folder beforehand, so please ignore that.

Thanks,

Michael

Dear Michael,


If i perform the same actions, i get:


Engine::openPackage start ("C:\Users\xxx\AppData\Local\Packages\MyScript.InteractiveInk.Demo-dev.Uwp_61w7z7qe2apj8\LocalState\File1.iink") (2)


It seems you does not store to localFolder.

Can you try to save the package without trying to get/set  metadata as you did at the end of your log ?


Regards,


Maël

Hi Maël,

I still get the same error regardless of saving the metadata:




----------------------------



Engine::createRenderer (132, 132.8, renderer provider)

Renderer::addListener start

Renderer::addListener end

Engine::createEditor (renderer provider)

Editor::Editor

Editor::setViewSize start (0, 0)

Editor::setViewSize end

Editor::setFontMetricsProvider start

Editor::setFontMetricsProvider end

Editor::addListener

Engine::openPackage start ("MathBox0.iink") (2)

Engine::openPackage end

ContentPackage::createPart start ("Math")

Engine::getSupportedPartTypes

ContentPart::ContentPart ("Math")

ContentPackage::createPart end

Editor::setPart start ("fiyoxwme")

Editor::configure start

Renderer::addListener start

Renderer::addListener end

Editor::configure end

IEditorListener::partChanged start

IEditorListener::partChanged end

Editor::setPart end

Editor::setViewSize start (795, 255)

Editor::setViewSize end

Renderer::drawCaptureStrokes start (0, 0, 796, 256)

Renderer::drawCaptureStrokes end

Renderer::drawTemporaryItems start (0, 0, 796, 256)

Renderer::drawTemporaryItems end

Renderer::drawModel start (0, 0, 796, 256)

Renderer::drawModel end

Renderer::drawBackground start (0, 0, 796, 256)

Renderer::drawBackground end

Editor::pointerDown (232, 24, 77728064, 0.5, 0, 1, 0)

Editor::pointerMove (232, 27.1748, 77728080, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (227, 19, 10, 14)

Renderer::drawCaptureStrokes end

Editor::pointerMove (234.381, 54.3874, 77728122, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (227, 19, 13, 41)

Renderer::drawCaptureStrokes end

Editor::pointerMove (235.175, 66.3685, 77728130, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (227, 19, 14, 53)

Renderer::drawCaptureStrokes end

Editor::pointerMove (235.969, 73.5874, 77728138, 0.5, 0, 1, 0)

Editor::pointerMove (238.387, 88.7811, 77728146, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (227, 19, 17, 76)

Renderer::drawCaptureStrokes end

Editor::pointerMove (239.181, 96.7937, 77728154, 0.5, 0, 1, 0)

Editor::pointerMove (239.975, 113.575, 77728163, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (228, 48, 17, 72)

Renderer::drawCaptureStrokes end

Editor::pointerMove (241.6, 121.587, 77728170, 0.5, 0, 1, 0)

Editor::pointerMove (242.394, 134.4, 77728178, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (231, 68, 17, 72)

Renderer::drawCaptureStrokes end

Editor::pointerMove (243.187, 140.787, 77728187, 0.5, 0, 1, 0)

Editor::pointerMove (243.187, 145.587, 77728194, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (234, 91, 15, 61)

Renderer::drawCaptureStrokes end

Editor::pointerMove (243.187, 155.187, 77728202, 0.5, 0, 1, 0)

Editor::pointerMove (243.981, 159.194, 77728210, 0.5, 0, 1, 0)

Editor::pointerMove (243.981, 168.794, 77728218, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (236, 116, 13, 59)

Renderer::drawCaptureStrokes end

Editor::pointerMove (243.981, 172.8, 77728226, 0.5, 0, 1, 0)

Editor::pointerMove (245.569, 176.769, 77728234, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (238, 140, 14, 43)

Renderer::drawCaptureStrokes end

Editor::pointerMove (246.4, 181.569, 77728242, 0.5, 0, 1, 0)

Editor::pointerMove (246.4, 183.194, 77728250, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (239, 154, 13, 35)

Renderer::drawCaptureStrokes end

Editor::pointerMove (247.194, 183.194, 77728266, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (239, 167, 14, 22)

Renderer::drawCaptureStrokes end

Editor::pointerUp (247.194, 183.194, 77728315, 0.5, 0, 1)

Renderer::drawCaptureStrokes start (240, 171, 13, 18)

Renderer::drawCaptureStrokes end

IEditorListener::contentChanged start (1 blocks)

IEditorListener::contentChanged MainBlock

IEditorListener::contentChanged end

Editor::pointerDown (371.2, 41.5748, 77728565, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (366, 36, 11, 12)

Renderer::drawCaptureStrokes end

Editor::pointerMove (371.2, 43.2, 77728572, 0.5, 0, 1, 0)

Editor::pointerMove (371.2, 50.3811, 77728580, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (366, 36, 11, 20)

Renderer::drawCaptureStrokes end

Editor::pointerMove (371.2, 53.5937, 77728588, 0.5, 0, 1, 0)

Editor::pointerMove (371.2, 62.4, 77728596, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (366, 36, 11, 32)

Renderer::drawCaptureStrokes end

Editor::pointerMove (371.2, 67.2, 77728604, 0.5, 0, 1, 0)

Editor::pointerMove (371.2, 77.5937, 77728612, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (366, 38, 11, 46)

Renderer::drawCaptureStrokes end

Editor::pointerMove (371.2, 83.1874, 77728620, 0.5, 0, 1, 0)

Editor::pointerMove (369.575, 94.3748, 77728628, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (364, 48, 13, 52)

Renderer::drawCaptureStrokes end

Editor::pointerMove (369.575, 99.1748, 77728637, 0.5, 0, 1, 0)

Editor::pointerMove (368.781, 111.194, 77728644, 0.5, 0, 1, 0)

Editor::pointerMove (368.781, 116.787, 77728652, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (363, 62, 14, 61)

Renderer::drawCaptureStrokes end

Editor::pointerMove (367.987, 122.381, 77728662, 0.5, 0, 1, 0)

Editor::pointerMove (365.569, 133.569, 77728668, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (360, 88, 16, 52)

Renderer::drawCaptureStrokes end

Editor::pointerMove (364.775, 140.787, 77728676, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (359, 106, 16, 41)

Renderer::drawCaptureStrokes end

Editor::pointerMove (361.6, 153.6, 77728687, 0.5, 0, 1, 0)

Editor::pointerMove (360.768, 158.4, 77728694, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (355, 111, 20, 53)

Renderer::drawCaptureStrokes end

Editor::pointerMove (359.975, 164.787, 77728703, 0.5, 0, 1, 0)

Editor::pointerMove (357.594, 172.8, 77728710, 0.5, 0, 1, 0)

Editor::pointerMove (357.594, 174.387, 77728718, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (352, 128, 20, 52)

Renderer::drawCaptureStrokes end

Editor::pointerUp (357.594, 174.387, 77728782, 0.5, 0, 1)

Renderer::drawCaptureStrokes start (352, 152, 15, 29)

Renderer::drawCaptureStrokes end

IEditorListener::contentChanged start (1 blocks)

IEditorListener::contentChanged MainBlock

IEditorListener::contentChanged end

Editor::pointerDown (454.387, 50.3811, 77729073, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (448, 44, 12, 12)

Renderer::drawCaptureStrokes end

Editor::pointerMove (454.387, 52.8, 77729088, 0.5, 0, 1, 0)

Editor::pointerMove (455.181, 55.1811, 77729096, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (448, 44, 13, 17)

Renderer::drawCaptureStrokes end

Editor::pointerMove (455.181, 59.1874, 77729104, 0.5, 0, 1, 0)

Editor::pointerMove (455.975, 61.5685, 77729112, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (448, 44, 13, 24)

Renderer::drawCaptureStrokes end

Editor::pointerMove (455.975, 65.5748, 77729120, 0.5, 0, 1, 0)

Editor::pointerMove (455.975, 68.7874, 77729128, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (448, 47, 13, 28)

Renderer::drawCaptureStrokes end

Editor::pointerMove (457.6, 71.1685, 77729136, 0.5, 0, 1, 0)

Editor::pointerMove (458.394, 81.6, 77729144, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (450, 54, 14, 34)

Renderer::drawCaptureStrokes end

Editor::pointerMove (458.394, 91.2, 77729153, 0.5, 0, 1, 0)

Editor::pointerMove (458.394, 102.387, 77729160, 0.5, 0, 1, 0)

Editor::pointerMove (458.394, 108.775, 77729168, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (451, 60, 14, 55)

Renderer::drawCaptureStrokes end

Editor::pointerMove (456.768, 119.169, 77729176, 0.5, 0, 1, 0)

Editor::pointerMove (455.975, 129.6, 77729184, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (451, 76, 14, 60)

Renderer::drawCaptureStrokes end

Editor::pointerMove (455.181, 138.368, 77729192, 0.5, 0, 1, 0)

Editor::pointerMove (453.594, 141.581, 77729200, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (448, 96, 16, 52)

Renderer::drawCaptureStrokes end

Editor::pointerMove (452.8, 147.175, 77729208, 0.5, 0, 1, 0)

Editor::pointerMove (452.8, 152.769, 77729216, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (447, 114, 16, 45)

Renderer::drawCaptureStrokes end

Editor::pointerMove (452.8, 154.394, 77729226, 0.5, 0, 1, 0)

Editor::pointerMove (451.969, 159.194, 77729232, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (447, 132, 14, 33)

Renderer::drawCaptureStrokes end

Editor::pointerMove (451.969, 163.2, 77729240, 0.5, 0, 1, 0)

Editor::pointerMove (451.969, 164.787, 77729250, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (447, 142, 12, 29)

Renderer::drawCaptureStrokes end

Editor::pointerMove (451.969, 165.581, 77729256, 0.5, 0, 1, 0)

Renderer::drawCaptureStrokes start (447, 148, 12, 24)

Renderer::drawCaptureStrokes end

Editor::pointerUp (451.969, 165.581, 77729347, 0.5, 0, 1)

Renderer::drawCaptureStrokes start (447, 154, 10, 18)

Renderer::drawCaptureStrokes end

IEditorListener::contentChanged start (1 blocks)

IEditorListener::contentChanged MainBlock

IEditorListener::contentChanged end

Renderer::drawModel start (226, 18, 238, 171)

Renderer::drawModel end

Renderer::drawCaptureStrokes start (228, 20, 235, 168)

Renderer::drawCaptureStrokes end

ContentPackage::save start

EXCEPTION class std::runtime_error "INVALID_ARGUMENT"

Thanks,

Michael


Answer

Dear Michael,


We reproduced your issue and indeed you try to write at a location where do do not have the rights.

Your "_packageName" should be generated like in the GetStarted example:


private static string MakeUntitledFilename()
{
    var localFolder = Windows.Storage.ApplicationData.Current.LocalFolder.Path;
    var num = 0;
    string name;

    do
    {
        var baseName = "File" + (++num) + ".iink";
        name = System.IO.Path.Combine(localFolder, baseName);
    }
    while (System.IO.File.Exists(name));

     return name;
}


It contains the concatenation of the localFolder path and the fileName.


Regards,


Maël

Login or Signup to post a comment