Link to home
Start Free TrialLog in
Avatar of interfaces
interfaces

asked on

Expresion too complex error in VB6

Hi all,

I have an aplication written in VB6 that in which I'm testing a linear equations solver implemented in a standard DLL in C. If I run the code not using the DLL (using the traditional solver in VB) the code runs well, but if I use the DLL, the software returns an "Expression too complex" error, interestingly enough, on another completely different part of the code. The C DLL is a straight translation from the original code, and, to add a little fun, this happens on one PC but nor in another, both using exactly the same version of VB (down to the service pack), Windows, and solver DLL. Have anybody seen anything like this?

Best regards


Avatar of mirzas
mirzas
Flag of Bosnia and Herzegovina image

Is the OS same on both machines?

What about regional settings?

You'd be surprised.
>> but if I use the DLL, the software returns an "Expression too complex" error
is this a runtime error? or at compile time when you try to build the DLL?
Avatar of interfaces
interfaces

ASKER

Hi Jaime,

It's a runtime error.

Cheers,

Miguel
Hello mirzas,

Regional settings, and OS versions are the same.

Regards,

Miguel
Here is a quote from the VB reference:


Visual Basic Reference: Error Messages
Expression too complex

A floating-point expression contains too many nested subexpressions.
To correct this error

    * Break the expression into as many separate expressions as necessary to prevent the error from occurring.


Now as for the different behavior on different machines.. there MUST be something that IS different between them.
Since you're using VB I do not see how hardware differences could cause this problem.
So it must be the software.
I was finally able to narrow the problem a bit. It seems that the calculation code (VB) is consuming too many resources. If I let the program run without doing anything else, It carries on ok, but If I try to do something else, the "Expression too complex" error occurs. On one PC the error happens under these circumstances, but on the other it happens every time. I guess I'll have to re-write all the equations in a more step-by-step mode, and see If i can get rid of the error.
ASKER CERTIFIED SOLUTION
Avatar of interfaces
interfaces

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial