clear

dll_handle  = loadlibrary( "UserAlgoDll.dll" )
if $dll_handle != 00
    
? "load success"
else
    
dll_handle  = loadlibrary( "UserAlgoDll64.dll" )
    
if $dll_handle == 00
        
? "load dll error"
        
pause
    
endif
endif
x           = freelibrary( $dll_handle )

dllname     = "UserAlgoDll.dll"
dll_handle  = loadlibrary( $dllname )
if $dll_handle != 00
    
? "load success"
else
    
dllname     = "UserAlgoDll64.dll"
    
dll_handle  = loadlibrary( $dllname )
    
if $dll_handle == 00
        
? "load dll error"
        
pause
    
endif
endif


fun_add     = getprocaddress( $dll_handle, "Fun_Add" )
if $fun_add != 00
    
t   = dllfun( $fun_add, 00000023, 00000022 )
    
if $t != 00000045
        
?
        
pause
    
endif
endif

funname     = "Fun_Add"
fun_add     = getprocaddress( $dll_handle, $funname )
if $fun_add != 00
    
t   = dllfun( $fun_add, 00000023, 00000022 )
    
if $t != 00000045
        
?
        
pause
    
endif
    
t   = dllfun( $fun_add, 000078978979878978970023, 0007891578fffff00022 )
    
if $t != 0000789F128F008978870045
        
?
        
pause
    
endif
endif

x           = freelibrary( $dll_handle )