We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

CalcQuick and CalcEngine threading

Thread ID:

Created:

Updated:

Platform:

Replies:

49728 Sep 25,2006 04:48 PM Oct 9,2006 03:27 AM Windows Forms 2
loading
Tags: Calculate
Eric Wellnitz
Asked On September 25, 2006 04:48 PM

We are currently evaluating Essential Calcualate to perform threaded calculations on data within our middle tier. I''m receiving an exception when attempting to access a new instance of CalcQuick and/or CalcEngine with multiple threads. The question I have is whether or not CalcQuick or CalcEngine support multiple threads.

Here is the code that is throwing the exception:

private void button1_Click(object sender, EventArgs e)
{
for (int index = 0; index < 5; index++)
{
BackgroundWorker worker = new BackgroundWorker();
worker.DoWork += new DoWorkEventHandler(worker_DoWork);
worker.RunWorkerAsync();
}
}

void worker_DoWork(object sender, DoWorkEventArgs e)
{
CalcQuick calc = new CalcQuick();
calc.AutoCalc = false;
calc["A1"] = "1";
calc.SetDirty();
}

Here is one of the exceptions being thrown and the call stack. When and what exception I receive seems to be intermitent.

Argument out of Range exception
Length cannot be less than zero.
Parameter name: length

at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
at Syncfusion.Core.Licensing.FusionLicenseProvider.GetAssemblyInformation(Type type, Int32& ver1, Int32& ver2, Int32& ver3, String& assemblyname)
at Syncfusion.Core.Licensing.FusionLicenseProvider.Validate(String str)
at Syncfusion.Core.Licensing.FusionLicenseProvider.GetLicense(LicenseContext context, Type type, Object instance, Boolean allowExceptions)
at System.ComponentModel.LicenseManager.ValidateInternalRecursive(LicenseContext context, Type type, Object instance, Boolean allowExceptions, License& license, String& licenseKey)
at System.ComponentModel.LicenseManager.ValidateInternal(Type type, Object instance, Boolean allowExceptions, License& license)
at System.ComponentModel.LicenseManager.Validate(Type type, Object instance)
at Syncfusion.Core.Licensing.LicensedComponent..ctor(Type type)
at Syncfusion.Calculate.CalcEngine..ctor(ICalcData ParentObject)
at Syncfusion.Calculate.CalcQuick.InitCalcQuick(Boolean resetStaticMembers)
at Syncfusion.Calculate.CalcQuick..ctor()
at CalcTest.Form1.worker_DoWork(Object sender, DoWorkEventArgs e) in D:\Projects\CalcTest\CalcTest\Form1.cs:line 33
at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)
at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)

Administrator [Syncfusion]
Replied On October 9, 2006 03:25 AM

Here is a link to a sample using your code that does not seem to have a problem.
http://www.syncfusion.com/Support/user/uploads/Calculate_threading_7daf79c8.zip


Administrator [Syncfusion]
Replied On October 9, 2006 03:27 AM

The call stack suggests this might e a licensing issue. You might look at this KB to see if that will avoid this problem.
www.syncfusion.com/support/kb/studio/Default.aspx?ToDo=view&questId=35

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;