In xHarbour, we use OleDefaultArg() where we need to skip arguments in some cases. NIL does not work.
I give an example here for testing:
- Code: Select all Expand view RUN
function JetConnectionCount( oCn )
local oRs := oCn:OpenSchema( -1, OleDefaultArg(), "{947bb102-5d43-11d1-bdbf-00c04fb92675}" )
local nRet := oRs:RecordCount()
oRs:Close()
return nRet
The above function works perfectly in xHarbour. We can not use "nil" as second parameter.
I am not able to find a substitute in Harbour to use in the place of OleDefaultArg(). I have similar usage in many other functions. This is preveting me from making my libraries fully compatible with Harbour.
Similary I use VTWrapper( 0 ) for NULL (through translates) in some of my functions. This is also not possible with Harbour.
The functions OleDefaultArg() and VTWrapper class are available in win32ole.prg in xHarbour.
For quick reference, I reproduce relevant extracts.
- Code: Select all Expand view RUN
#define VT_ERROR 10
#define DISP_E_PARAMNOTFOUND (0x80020004)
//----------------------------------------------------------------------------//
function OleDefaultArg()
return VTWrapper( VT_ERROR, DISP_E_PARAMNOTFOUND )
//----------------------------------------------------------------------------//
CLASS VTWrapper
DATA vt
DATA Value
METHOD New( vt, xVal ) CONSTRUCTOR
ENDCLASS
//----------------------------------------------------------------------------//
METHOD New( vt, xVal ) CLASS VTWrapper
::vt := vt
::Value := xVal
return Self
//----------------------------------------------------------------------------//
May be the solution is easy, but is eluding me.
I request any one who has found or can find a solution to my problem to help me.