Error on pcltool.dll when a large number of files are processed

Hello!

We are using the Spool File Page Counter SDK on our print management service. Basically, we have a service and every time it intercepts a new print job, it analyzes its .SPL file.

So, we could have multiple threads accessing and using the SDK at the same time, it works well when there aren't a large number of files being processed.

But on our load/stress tests we usually send a large number of print jobs to the printers, that's when we are getting an error within the SDK, on the windows event viewer a pcltool.dll error can be found.

After the first error occurs, we will get the same problem every time we try to analyze a file, no matter how many files or its sizes.

I'm sending a print of the problem, I believe that is related to the amount of files that the SDK try to process, maybe a thread problem, as a many of them are using the SDK at the same time.

In our production version, we will most likely face this kind of environment, where a large number of files will be processed at the "same time".

Have you ever faced this kind of issue ? Is there a solution for this or a workaround that we could use?

Customer
---------------------------------------
here is the print of the error.

I forgot to mention but when this error occurs, the results of the SDK analyzes are all wrong.

image

Customer
---------------------------------------
Yes, I guess it may caused by multiple thread problem. In order to solve this problem completely, I guess the following two solutions may useful to you,

Solution 1:

If you are calling ReadInfo.dll library inside a multiple thread function in your source code, you may call ReadInfoFromAllFormats() function to parse all of your SPL files one by one, you may use a Global Value or a Mutex Object to avoid multiple thread call to ReadInfoFromAllFormats() function at same time, this problem will be solved completely.

Solution 2:

You can create a simple Command Line EXE application to call ReadInfoFromAllFormats() function from ReadInfo.dll library, then you can call this EXE application from your main EXE application, because this Command Line EXE application running inside another process space, so you can run multiple instances of this Command Line EXE application without any problem.

With this method, you could able to use "Spool File Page Counter SDK" to analyze more of your SPL files at same time.

We hoping above two solutions will useful to you, you may give them to try.

VeryDOC

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

After I sent the ticket to you, I thought another solution.

I guess this problem may caused by memory management mechanism between C# and C++, I have another solution for you to solve this problem quickly and completely.

This solution will work like below,

1. You may register FileInfoCOM.exe into your system by following command line with administrator privilege,

FileInfoCOM.exe /regserver

You can also run "install.vbs" to register FileInfoCOM.exe into your system automatically.

2. You can use FileInfoCOM.exe to instead of ReadInfo.dll DLL library, you can call FileInfoCOM.exe from C# by following sample source code,

--------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using FileInfoCOM;

namespace ParsingTest {
    class Program {

        static void Main(string[] args)
        {
            if (args.Length != 1)
            {
                Console.WriteLine("test.exe C:\\test.pcl");
                Console.WriteLine("test.exe C:\\test.ps");
                return;
            }
            Console.Write("args length is ");
            Console.WriteLine(args.Length); // Write array length
            for (int i = 0; i < args.Length; i++) // Loop through array
            {
                string argument = args[i];
                Console.Write("args index ");
                Console.Write(i); // Write index
                Console.Write(" is [");
                Console.Write(argument); // Write string
                Console.WriteLine("]");
            }
            string fileName = args[0];
            int bIsRenderToPDF = 0;
            int bwPageCount = 0;
            int colorPageCount = 0;
            int copyCount = 0;
            double nPageWidth = 0;
            double nPageHeight = 0;
            string strPaperSizeName = new string(' ', 300);

            FileInfoCOM.FileInfoClass objFileInfoCom = new FileInfoCOM.FileInfoClassClass();

            objFileInfoCom.com_ReadInfoSetCode("XXXXXXXXXXXXXXXXXX");
            objFileInfoCom.com_ReadInfoFromPCLFile(fileName, bIsRenderToPDF, ref bwPageCount, ref colorPageCount,
                    ref copyCount, ref nPageWidth, ref nPageHeight, ref strPaperSizeName);

            Console.WriteLine(String.Format("File: {0}", fileName));
            Console.WriteLine(String.Format("Render To PDF: {0}", bIsRenderToPDF));
            Console.WriteLine(String.Format("BW Pages: {0}", bwPageCount));
            Console.WriteLine(String.Format("Color Pages: {0}", colorPageCount));
            Console.WriteLine(String.Format("Width: {0}", nPageWidth));
            Console.WriteLine(String.Format("Height: {0}", nPageHeight));
            Console.WriteLine(String.Format("Paper name: {0}", strPaperSizeName));
        }
    }
}
--------------------

3. You may call "FileInfoCOM.FileInfoClass objFileInfoCom" from a multiple thread function to parse more SPL files at same time, you can use this method to check if you could parse more SPL files from C# multiple threads properly.

Because "FileInfoCOM.exe" is another EXE process, it does use a different memory management mechanism compare to C# process, I guess the "FileInfoCOM.exe" will able to solve this problem to you too.

VeryDOC

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)

Related Posts

This entry was posted in PCL, PS, PDF Page Counter and tagged , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *


Verify Code   If you cannot see the CheckCode image,please refresh the page again!