LoadNewDll
DLLNumber = LoadNewDll(Filename$)
 
Parameters:

    Filename$ = The file name and path of the DLL you wish to load
Returns:

    DLLNumber = The index of this DLL number to use
 

      LoadNewDll will read a DLL from disk into your computer's memory for later use. Unlike LoadDll, you just provide this command with the path and filename of the DLL to load, and it will a allocate free DLL index for you.



FACTS


      * You can only use standard DLLs. See: NewAX for ActiveX support.

      * Use GetDllExist to check if DLL has already been loaded.

      * Use GetDllCallExist to check if a function exists within a loaded DLL

      * Use DllCallConv to change the calling convention used to call functions from a DLL.




Mini Tutorial:


      This example shows how to toggle the visibility of the mouse cursor using Windows' user32.dll.

  
  Filename$="User32.dll"
  
; Check if the DLL file has been loaded ?
  If GetDllExist(Filename$) =0
     
     Print "Loading DLL"
     
   ; Load the USer32 dll into memory ready for use
     User32=LoadNewDll("user32.dll")
     
     
  EndIf
  
  
; Check if function "ShowCursor" exists in this DLL
  If GetDllCallExist(user32,"ShowCursor"= 1
     Print "Calling Function 'ShowCursor' from this dll"
     Print ""
     
   ; "ShowCursor" only expects one parameter:
   ; passing 1 will show the mouse, 0 will hide it
     Print "Hiding Mouse POinter"
   ; Hide the mouse cursor
     CallDll(user32,"ShowCursor",0)
     
     Print "Press any key to show the mouse pointer again"
     Sync
     WaitKey : WaitNoKey
   ; Show the mouse cursor
     CallDll(user32,"ShowCursor",1)
     Print "The mouse is back."
     Print ""
     
  Else
     Print "SOrry this function doesn't exist in this dll"
  EndIf
  
  Sync
  WaitKey
  
; Delete the DLL from memory
  DeleteDll user32
  


 
Related Info: DeleteDll | GetDLLCallExist | GetDllExist | GetDllFileName$ | GetDllStatus | GetFreeDll | LinkDll | LoadDLL | NewAx :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com