Introducing QuantLib as a COM object
Posted by Marco Marchioro-2 on Mar 06, 2001; 3:48pm
URL: http://quantlib.414.s1.nabble.com/it-has-been-quiet-tp1689p1690.html
Dear All,
I am glad to announce that it is now possible to use most QuantLib objects
as COM.
This means that your favorite spreadsheet is now able to make calls to
QuantLib.
You can register the COM object on your machine executing
QuantLib\Python\COM\importlibrary.py.
A COM object with ID name 'Python.ImportLibrary' will be available on your
machine.
More documentation can be found in the file importlibrary.py, including an
example
which calls QuantLib from VB.
Remember the followings:
1) To unregister the object 'Python.ImportLibrary' from your machine run
> importlibrary.py --unregister
from the DOS command line.
2) The objects will be registered to be called as DLL. Change the lines
_reg_clsctx_ = pythoncom.CLSCTX_INPROC_SERVER
with
_reg_clsctx_ = pythoncom.CLSCTX_LOCAL_SERVER
or
_reg_clsctx_ = pythoncom.CLSCTX_REMOTE_SERVER
if you want a different behavior
3) There is nothing special in QuantLib, your favorite python module can be
imported as COM using 'Python.ImportLibrary'
4) 'Python.ImportLibrary' is still under development and has not been
tested much
5) You do NOT need to reregister ImportLibrary if QuantLib is recompiled.
This means that
new classes are available in COM as soon as they are in python. You just
need to make sure
that QuantLib.py is reachable by the python path.
Enjoy QuantLib as COM,
Marco Marchioro.