Btw, check this out
Code:
Option Explicit
Private Declare Function LongLongMul Lib "ntdll" Alias "_allmul" (ByVal cFirst As Currency, ByVal cSecond As Currency) As Currency
Private Sub Form_Load()
Dim a As Currency
Dim b As Currency
Dim c As Currency
a = 12 / 10000@
b = 34 / 10000@
c = LongLongMul(a, b) * 10000@
Debug.Assert c = 12 * 34
End Sub
And it seems that all of the rest of C/C++ compiler intrinsics for dealing with __int64 are present in ntdll.dll too
Code:
2005 0x0002E2C0 _alldiv
2006 0x0002E370 _alldvrm
2007 0x0002E460 _allmul
2011 0x0002E4C0 _allrem
2012 0x0002E580 _allshl
2013 0x0002E5A0 _allshr
2014 0x000E1F22 _atoi64
2015 0x0002E600 _aulldiv
2016 0x0002E670 _aulldvrm
2017 0x0002E710 _aullrem
2018 0x0002E790 _aullshr
These API functions would be best to be available from a typelib to skip GetLastError call.
Edit: Here is one alt implementation of these APIs -- https://source.winehq.org/source/dlls/ntdll/large_int.c
cheers,
</wqw>