Error usando WNetAddConecction2

Edisson Villa
04 de Junio del 2009
Estoy utilizando esta funcion y me genera el error 487: Attempt to access invalid address.

La funcion es:
FUNCTION _MapDrive1( tcResource, tcPassword, tcUsername, tcflags)
LOCAL lnRet
DECLARE INTEGER WNetAddConnection2 IN WIN32API STRING @lpzRemoteName,
STRING @lpzPassword, STRING @lpzUsername, INTEGER @lpzLocalName
IF PARAMETERS() < 4
lnRet = WNetAddConnection2( @tcResource, @tcPassword, @tcUsername,
0)
ELSE
lnRet = WNetAddConnection2( @tcResource, @tcPassword, @tcUsername,
@tcflags)
ENDIF
RETURN lnRet
ENDFUNC


Y la invoco:
lcconecta = _MapDrive1('G:\familiarfpos','juan','fredy',0)


Me podrian ayudar , ya que la coneccion la debo hacer pidiendo usuario y password.


Gracias.....