Error Id = -2 [SOLVED]

Label printing integration (NiceWatch middleware and ActiveX programming interface)

Moderator: NiceLabel Support Team

Error Id = -2 [SOLVED]

Postby Dex » Tue May 06, 2008 1:07 pm

Hello,

I'm using NL in a .net C# application.
My program is creating a NiceLabel object and then :
- Modifiying some variables using WRVar.SetValue
- Printing the label using .Print
- Modifying some variables...
- Printing the label
...

This is done in a "for" loop and working smoothly generating as many print jobs (that I can see in the printer spooler).
The NiceLabel object is not destructed/recreated during the for loop only some of its variables are changed and then it is printed again this to work faster as the object stays in memory (array where the key is the lbl file name) for the duration of the application life.

Now, as severals PC are using the same printer I would like to avoid the risk of mixing prints so I thought I could use the sessionstart/print/end feature.
The goal for me is to have all prints generated by the "for" loop of PC number 1 in one print job, all prints of PC number 2 in one spool instead of having the number of "print command" of spool.
My understanding is that session allow to do that.

So I added a SessionStart before the "for" loop, one SessionEnd after the for loop and instead of Print I used SessionPrint.

The gap is that after the first loop of the "for", NiceLabel return an error with Id -2 when I try to update the variables, there is no message for this errorID (-2), NL only ask me to make sure that I've the latest release (then engin 5WR dll is tagged 5.0.2.1569)...

Can you help on this ?.

Many thanks,

David
Last edited by Dex on Wed May 07, 2008 10:29 am, edited 1 time in total.
Dex
Valued Contributor
 
Posts: 37
Joined: Wed Jan 17, 2007 3:30 pm
Location: France

Postby Dex » Wed May 07, 2008 10:07 am

Hello,

I've updated NiceEngine DLL getting 5.1.0.1919 while doing a .GetVersion in my program.
The SessionStart is ok, I can update variables but get error 91083 while using sessionPrint... Can anyone help on this ?.

[EDIT] : seems that I've found the problem... The sessionStart seems to clear all variables of the Label ! and that explain the error...

Previous working code with no Session :
- Open the label
- Set printer
- Set nearly all variables
- start of the "for" loop
- update some variables
- print
- end of the "for" loop

Non working code with Session:
- Open the label
- Set printer
- Set nearly all variables
- Start session
- start of the "for" loop
- update some variables
- Session print
- end of the "for" loop
- end of the session

Working code with Session:
- Open the label
- Start session
- Set printer
- Set nearly all variables
- start of the "for" loop
- update some variables
- Session print
- end of the "for" loop
- end of the session

Perhaps that I've missed this in the documentation but I don't remind that sessionstart cleaning variables feature was documented :).

Best regards,

David
Dex
Valued Contributor
 
Posts: 37
Joined: Wed Jan 17, 2007 3:30 pm
Location: France

Postby Saso » Wed May 07, 2008 11:07 am

Dex,

Thank you for this very elaborate finding. :D
I will make sure the documentation is updated with this info.
Saso Fleiser
Senior Technical Product Specialist
User avatar
Saso
NiceLabel
NiceLabel
 
Posts: 2239
Joined: Mon Sep 04, 2006 8:09 am

Postby bastv » Thu May 15, 2008 1:43 pm

thanx! i had the same problem
bastv
Enthusiast
 
Posts: 20
Joined: Tue Aug 28, 2007 4:44 pm
Location: Netherlands


Return to Label Printing Integration & Programming

Who is online

Users browsing this forum: Google [Bot] and 0 guests