Can I use a CalcQuick instance in a Windows Service?

Hi,

I try this in a test windows service:

Protected Overrides Sub OnStart(ByVal args() As String)

Dim oCalc As New Syncfusion.Calculate.CalcQuick
oCalc("x") = 5
oCalc("y") = 2
oCalc("z") = "=[x] + [y]"
oCalc.SetDirty()
My.Computer.FileSystem.WriteAllText("F:\Escritorio\ServLog.txt", "z es : " & oCalc("z"), True)

End Sub

then, in my text file, I obtain this:

z es : =[x] + [y]

instead of:

z es : 7

But in a console application this same code works fine. Can I use a CalcQuick instance in a Windows Service?

I use Syncfusion Essential Studio 4.2.0.37

2 Replies

AD Administrator Syncfusion Team May 29, 2007 10:02 PM UTC

Just something to try, not sure whether this will affect this problem or not. After the

Dim oCalc As New Syncfusion.Calculate.CalcQuick

try adding:

CalcEngine.FormulaCharacter = '='

In 4.4 and earlier, there is a problem with this shared (static) field being initialized properly in server code. This has been corrected in 5.1.


JO Jorge May 29, 2007 11:57 PM UTC

Hi Clay,

I add the lines of code that you suggested and the service now works.

Thank you very much for your help.

Loader.
Up arrow icon