Git Product home page Git Product logo

Comments (4)

Hanqnero avatar Hanqnero commented on July 26, 2024

Also, in the debug output there's an exception System.Runtime.InteropServices.COMException whenever the mathematical expression changes.

from kalq.

odinis avatar odinis commented on July 26, 2024

Having the same issue.

from kalq.

KarlRamstedt avatar KarlRamstedt commented on July 26, 2024

Same issues here. Seems like an external dependency is causing problems.

https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.comexception?view=netframework-4.0

from kalq.

lrq3000 avatar lrq3000 commented on July 26, 2024

I have been investigating a bit this bug, as I also was interested in making Kalq functional as a more mathematically complete alternative to Launchy's calculator.

I could track down the bug to this line:

interpreter.AddCode(script.Code)

interpreter.AddCode(script.Code)

Where interpreter is:

    ' MS Script Control object, the main engine of kalq
    Private interpreter As New MSScriptControl.ScriptControl

By looking online (it's been decades since I last coded in VB), it seems the issue stems from either a missing, corrupted, misregistered or wrong architecture (project needs to be set in 32-bits mode) msscript.ocx dll. So yes it's difficult to make it work not only in debug, but also in release, because you have to ship the correct dll and it seems it only exists in 32 bits, it's been long deprecated.

So the solution would be to replace this approach with a real math expression evaluator engine, which would also be much safer, as currently Kalq relies on executing any VBscript expression, not just math! So theoretically a nefarious actor could make you execute anything by hijacking your copy/paste (which is possible from websites!).

I had a quick look but it seems math engines are rare for VB, I found this incomplete one but it's much more verbose and complex to use: https://www.jefflewis.net/programming-vb-calculator.html#ModuleMathParser

Given all these limitations and difficulties, I decided to try alternative solutions, and for now I have settled for Qalculate (a much more mature and actively maintained math engine and GUI, much more powerful than Kalq even when it was working), combined with Clavier+ to create a hotkey to mimic how Launchy can be summoned with a simple ALT-LEFT+SPACE hotkey. So far, this approach works wonderfully well, and I get a very powerful math engine, and less memory footprint since it is launched only when I summon it (instead of having a service always running in the background as with Launchy or Kalq), so I likely won't try to fix Kalq as it is a less optimal solution in any case.

from kalq.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.