+ Reply to Thread
Results 1 to 3 of 3

Incorrect division by zero when using DLL function

  1. #1
    Registered User
    Join Date
    05-09-2007
    Posts
    2

    Incorrect division by zero when using DLL function

    Hello All
    I have written a cpp functiion and am using the dll function ( I have checked for name decoration etc) in a VBA code

    The Declaration of the function is


    extern "C" double DLLEXPORT __stdcall vgDelta(double stockprice,double strikeprice,double sigma,double VGtheta,double nu,double tenor,double riskfreerate);

    and the export with name decoration correction is
    EXPORTS
    vgDelta = _vgDelta@56



    using it in macro with import in this fashion :


    Declare Function vgDelta Lib "test.dll" (ByVal stockprice As Double, ByVal strikeprice As Double, ByVal sigma As Double, ByVal VGtheta As Double, ByVal nu As Double, ByVal tenor As Double, ByVal riskfreerate As Double) As Double


    Function test() As Double
    Dim abc As Double
    abc = vgDelta(1742, 1742, 0.175639616, -0.071753491, 0.132, 0.986, 0.00001)
    test = abc

    End Function



    I have debugged the code the values of arguments are passed correctly and the return value is also calculated correctly but the VBA code says

    Run-time error "11"
    "Division by zero"



    Where could i be going wrong?, please help ...

    Thanx in advance
    Manik

    Ps: Using unmanaged cpp vs 2005 and excel 2003

  2. #2
    Registered User
    Join Date
    05-09-2007
    Posts
    2
    Really hoping for some help here ...

  3. #3
    Registered User
    Join Date
    05-11-2007
    Posts
    1

    Same problem

    Hi,

    I have a program that was working fine until yesterday. But now, it gives me this division by zero error. Was your working as well until yesterday? I'm thinking it's a security update issue. Also, my program doesn't do any division.

    Charles

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1