Here is my declaration in VB right now:
Public Declare Sub find_newXY Lib "vbdll.dll" (matrix As Double, ByVal xVal As Long, ByVal yVal As Long, ByRef finalX As Long, ByRef finalY As Long)
Here is the corresponding declaration in my C++ DLL file:
void _stdcall find_newXY(double *matrix, long xVal, long yVal, long *finalX, long *finalY)
___________________________________________________________________________________________
My question is, even though I have no intention of modifying xVal and yVal within the c++ function, wouldnt it be faster to pass those by reference as well?
This function will be called several times a second so any speed increase would help.
Also, if I did pass them by reference, could I make the function declaration like this:
void _stdcall find_newXY(double *matrix, long &xVal, long &yVal, long *finalX, long *finalY)
or do I need to use "*" instead of "&"
Public Declare Sub find_newXY Lib "vbdll.dll" (matrix As Double, ByVal xVal As Long, ByVal yVal As Long, ByRef finalX As Long, ByRef finalY As Long)
Here is the corresponding declaration in my C++ DLL file:
void _stdcall find_newXY(double *matrix, long xVal, long yVal, long *finalX, long *finalY)
___________________________________________________________________________________________
My question is, even though I have no intention of modifying xVal and yVal within the c++ function, wouldnt it be faster to pass those by reference as well?
This function will be called several times a second so any speed increase would help.
Also, if I did pass them by reference, could I make the function declaration like this:
void _stdcall find_newXY(double *matrix, long &xVal, long &yVal, long *finalX, long *finalY)
or do I need to use "*" instead of "&"