Load a DLL globally

This task describes how to load a DLL globally, to make its functions available to all your Vuser scripts. Once the DLL is loaded, you can call any function defined within the DLL, without having to declare it in your script.

To globally load DLLs:

  1. Add a list of the DLLs you want to load to the appropriate section of the mdrv.dat file, located in your application's dat folder.

    Use the following syntax:

    PLATFORM_DLLS=my_dll1.dll, my_dll2.dll, ...

    replacing the word PLATFORM with your specific platform. For a list of platforms, see the beginning section of the mdrv.dat file.

    For example, to load DLLs for Winsock Vusers on an NT platform, include the following section in the mdrv.dat file:

    Example: [WinSock]

    ExtPriorityType=protocol

    WINNT_EXT_LIBS=wsrun32.dll

    WIN95_EXT_LIBS=wsrun32.dll

    LINUX_EXT_LIBS=liblrs.so

    SOLARIS_EXT_LIBS=liblrs.so

    HPUX_EXT_LIBS=liblrs.sl

    AIX_EXT_LIBS=liblrs.so

    LibCfgFunc=winsock_exten_conf

    UtilityExt=lrun_api ExtMessageQueue=0

    ExtCmdLineOverwrite=-WinInet No

    ExtCmdLineConc=-UsingWinInet No

    WINNT_DLLS=user_dll1 .dll, user_dll2 .dll, ...

  2. Call the function defined in the DLL in the appropriate place within your script.