- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I experienced very strange behaviours of "my.dll", for example when it is called from VBA (wrong computations, Excel crashes, and so on: see my mail of 19 august).
Now I wonder: Is it possible that this strange behaviour is due to the use of IMSL procedures inside my.dll?
That is: if "my.dll" uses only standard fortran statements, everything is OK: I can use my.dll from Excel-VBA, and the computation works correctly even in different PCs.
But Excel crashes when a IMSL procedure is required.
All the best to everybody, Stefano
Now I wonder: Is it possible that this strange behaviour is due to the use of IMSL procedures inside my.dll?
That is: if "my.dll" uses only standard fortran statements, everything is OK: I can use my.dll from Excel-VBA, and the computation works correctly even in different PCs.
But Excel crashes when a IMSL procedure is required.
All the best to everybody, Stefano
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A CVF DLL that uses IMSL should be fine with one proviso: if IMSL wants to write to a console then the DLL had better provide one. VB or Excel/VBA as client of the DLL can't do that AFAIW. Have you tested your DLL using a CVF console application client? I don't use Excel/VBA much, but IIRC, it's hostile to single precision floats.
Anyhow, a CVF DLL using IMSL can be called without problems from VB.
HTH,
Gerry T.
Anyhow, a CVF DLL using IMSL can be called without problems from VB.
HTH,
Gerry T.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I made a mistake in the VBA code:
Option Explicit
Dim i, j As Long
does not imply that "j" is actually long (maybe it is trated as Variant or something else)
I had to write
Dim i As Long
Dim j As Long
The mistake was not recognize by the VBA compiler,
and then the dll is called but the effects were catastrophic.
Now in my PC the code works correctly, tomorrow I will
check the portability.
Thanks to everybody for all suggestions, Stefano
Option Explicit
Dim i, j As Long
does not imply that "j" is actually long (maybe it is trated as Variant or something else)
I had to write
Dim i As Long
Dim j As Long
The mistake was not recognize by the VBA compiler,
and then the dll is called but the effects were catastrophic.
Now in my PC the code works correctly, tomorrow I will
check the portability.
Thanks to everybody for all suggestions, Stefano
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You could write:
Dim i As Long, j As Long, x As Double, y As Single, ... etc.
If the type is not given after the variable name, then it is assumed as default, which in VB is Variant.
Sabalan.
Dim i As Long, j As Long, x As Double, y As Single, ... etc.
If the type is not given after the variable name, then it is assumed as default, which in VB is Variant.
Sabalan.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page