LoadUserSettings/SaveUserSetting and History and "Invalid ZIP-format value" SOLVED
Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan
Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
-
- User
- Posts: 1372
- Joined: Thu Sep 05, 2019 12:35 pm
LoadUserSettings/SaveUserSetting and History and "Invalid ZIP-format value"
Hi support,
At the moment of IPXV_Inst::Init call I do not have access to the file for pUserSettingsSrc or pHistorySrc, so I'm using LoadUserSettings at a later stage. LoadUserSettings accepts only one file (for settings, not for history?).
While the instance is alive, opening documents places them in the history, closing and reopening the controls' host form - and the history is there without me calling for "SaveUserSettings" - so history is automagically maintained during Inst's life. I'm calling SaveUserSettings at app shutdown.
The next time I run the application, the history is lost (other settings are here).
I've tried manually using SaveHistory and this does create the file.
However it seems the history is not picked by LoadUserSettings ?
So, I've tried executing "op.settings.import" right after LoadUserSettings (only "History" set to true) - but I get "AFSLib: Invalid ZIP-format value" on op.Do() call. What's this error about?
I know there's no LoadHistory (yet).
So, should LoadUserSettings load the history as well or not, or ?
How to load the history if I cannot use pHistorySrc in Init ?
-žarko
At the moment of IPXV_Inst::Init call I do not have access to the file for pUserSettingsSrc or pHistorySrc, so I'm using LoadUserSettings at a later stage. LoadUserSettings accepts only one file (for settings, not for history?).
While the instance is alive, opening documents places them in the history, closing and reopening the controls' host form - and the history is there without me calling for "SaveUserSettings" - so history is automagically maintained during Inst's life. I'm calling SaveUserSettings at app shutdown.
The next time I run the application, the history is lost (other settings are here).
I've tried manually using SaveHistory and this does create the file.
However it seems the history is not picked by LoadUserSettings ?
So, I've tried executing "op.settings.import" right after LoadUserSettings (only "History" set to true) - but I get "AFSLib: Invalid ZIP-format value" on op.Do() call. What's this error about?
I know there's no LoadHistory (yet).
So, should LoadUserSettings load the history as well or not, or ?
How to load the history if I cannot use pHistorySrc in Init ?
-žarko
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
Re: LoadUserSettings/SaveUserSetting and History and "Invalid ZIP-format value"
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 1372
- Joined: Thu Sep 05, 2019 12:35 pm
Re: LoadUserSettings/SaveUserSetting and History and "Invalid ZIP-format value"
Hi Alex,
That is the topic I have followed.
Note:
-ž
That is the topic I have followed.
Note:
So, I've tried executing "op.settings.import" right after LoadUserSettings (only "History" set to true) - but I get "AFSLib: Invalid ZIP-format value" on op.Do() call. What's this error about?
-ž
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
Re: LoadUserSettings/SaveUserSetting and History and "Invalid ZIP-format value"
Hello žarko,
Can you please create a small project that we can debug and find out why is this happening.
Cheers,
Alex
Can you please create a small project that we can debug and find out why is this happening.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- Site Admin
- Posts: 2353
- Joined: Thu Jun 30, 2005 4:11 pm
- Location: Canada
Re: LoadUserSettings/SaveUserSetting and History and "Invalid ZIP-format value"
Hi žarko.
In the upcoming new 335 build you will be able to use new function:
Cheers.
In the upcoming new 335 build you will be able to use new function:
Code: Select all
IPXV_Inst::LoadHistory(IUnknown* pHistorySrc, LONG nFlags = 0);
pHistorySrc - it can be pointer to IString(full path to the file or to the registry key), or pointer to the IAFS_Name|IAFS_File|IStream
nFlags - is zero by default, but you can specify the PXV_LoadHistory_Merge flag to merge existing history and new one.
Vasyl Yaremyn
Tracker Software Products
Project Developer
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Tracker Software Products
Project Developer
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
-
- User
- Posts: 1372
- Joined: Thu Sep 05, 2019 12:35 pm
Re: LoadUserSettings/SaveUserSetting and History and "Invalid ZIP-format value"
Hi Vasyl,
Thanks, sounds great.
Do I still have to provide a sample app for this issue "Invalid ZIP-format value"? I guess you would prefer C#?
-ž
Thanks, sounds great.
Do I still have to provide a sample app for this issue "Invalid ZIP-format value"? I guess you would prefer C#?
-ž
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
Re: LoadUserSettings/SaveUserSetting and History and "Invalid ZIP-format value"
Hello žarko,
Yes, we will need a C# project for investigation - it's not urgent though.
Cheers,
Alex
Yes, we will need a C# project for investigation - it's not urgent though.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 1372
- Joined: Thu Sep 05, 2019 12:35 pm
Re: LoadUserSettings/SaveUserSetting and History and "Invalid ZIP-format value"
Hi Alex,
Ok, will try to prepare it in the coming days ....
-ž
Ok, will try to prepare it in the coming days ....
-ž
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
Re: LoadUserSettings/SaveUserSetting and History and "Invalid ZIP-format value"
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 1372
- Joined: Thu Sep 05, 2019 12:35 pm
Re: LoadUserSettings/SaveUserSetting and History and "Invalid ZIP-format value"
Hi Alex,
In the FullDemo, MainFrm constructor, you do "CustomInitSDK" if fLoadPrefs or fLoadHist are set ...
Make sure those are, and have the next code for and after the call to Init :
So, the Init method is called without specifying pUserSettingsSrc, pHistorySrc and pHistoryThumbsSrc.
Then I use LoadUserSettings to load settings from (the same) prefsPathStr and then "op.settings.import" to import only the history from histFileStr.
Op.Do() would raise the mentioned exception "Invalid ZIP-format value".
HTH.
-žarko
In the FullDemo, MainFrm constructor, you do "CustomInitSDK" if fLoadPrefs or fLoadHist are set ...
Make sure those are, and have the next code for and after the call to Init :
Code: Select all
//Inst.Init(null, licKey, prefsPathStr, histFileStr, histThumbsFileStr);
// so we do "plain" init ..
Inst.Init(null, licKey, null, null, null);
//then we load user settings
Inst.LoadUserSettings(prefsPathStr);
//then we try to load/import the history only
PDFXEdit.IOperation op = Inst.CreateOp(Inst.Str2ID("op.settings.import"));
PDFXEdit.ICabNode opts = op.Params.Root["Options"];
op.Params.Root["Input"].v = histFileStr;
opts["History"].v = true;
opts["Settings"].v = false;
opts["Presets"].v = false;
opts["TrustedList"].v = false;
opts["Prompts"].v = false;
opts["UILang"].v = false;
try
{
op.Do();
}
catch (Exception ex)
{
PDFXEdit.IAUX_Inst aux = (PDFXEdit.IAUX_Inst)Inst.GetExtension("AUX");
var error = aux.FormatHRESULT(System.Runtime.InteropServices.Marshal.GetHRForException(ex), 0);
throw new Exception(error);
//AV here ...
}
Then I use LoadUserSettings to load settings from (the same) prefsPathStr and then "op.settings.import" to import only the history from histFileStr.
Op.Do() would raise the mentioned exception "Invalid ZIP-format value".
HTH.
-žarko
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
Re: LoadUserSettings/SaveUserSetting and History and "Invalid ZIP-format value"
Hello žarko,
Thanks, I will take a look when I have time.
Cheers,
Alex
Thanks, I will take a look when I have time.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- Site Admin
- Posts: 2353
- Joined: Thu Jun 30, 2005 4:11 pm
- Location: Canada
Re: LoadUserSettings/SaveUserSetting and History and "Invalid ZIP-format value" SOLVED
Hi -žarko.
This will not work definitely because here you need to specify the file that you may get only by using the "op.settings.export" operation.
Cheers.
Code: Select all
op.Params.Root["Input"].v = histFileStr;
Cheers.
Vasyl Yaremyn
Tracker Software Products
Project Developer
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Tracker Software Products
Project Developer
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
-
- User
- Posts: 1372
- Joined: Thu Sep 05, 2019 12:35 pm
Re: LoadUserSettings/SaveUserSetting and History and "Invalid ZIP-format value"
Thanks Vasyl,
Case closed
-ž
Case closed
-ž
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
Re: LoadUserSettings/SaveUserSetting and History and "Invalid ZIP-format value"
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ