Hi Peter, "C:\Windows\System32" or the similar location is always part of the PATH variable in windows, so there is no need to specify where to find the DLL - Windows will take care of it.
If there really is a risk that another DLL with the same name exists, one solution may be to copy the DLL from system32 to the same location as the MBX, before calling any functions in the DLL. Only problem could be if mapinfo loads the DLL at the time of the Declare statement, but that can easily be tested. Regards Uffe ----- Original Message ----- From: "Peter Horsbøll Møller" <[EMAIL PROTECTED]> To: <mapinfo-l@lists.directionsmag.com> Sent: Tuesday, February 14, 2006 12:27 PM Subject: [MI-L] External dll with variable path Hi, Has anyone ever tried accessing an external dll in a variable location ? I'm building a MapBasic application, that should use a dll placed in Windows\System32. On my computer I know ehere this is, but I guess I can't be sure whether it always will be located in C:\Windows on other computers ? So how do I tell MapBasic to use the dll from the System32 folder ? I can't use this: Declare Function BLAccessFile$ Lib "C:\Windows\System32\BLMarkProvider.dll" Alias "udtraekDb" () As String and this one the compiler doesn't like (APIWindowSystem32Folder$() is my own function returning the location of Windows\System32): Declare Function BLAccessFile$ Lib APIWindowSystem32Folder$() + "BLMarkProvider.dll" Alias "udtraekDb" () As String I also tried it with ApplicationDirectory$() but that didn't work either, so the problem might be the use of a function ??!! and with this one I can't be sure that MapInfo will use the right dll: Declare Function BLAccessFile$ Lib "BLMarkProvider.dll" Alias "udtraekDb" () As String Any ideas ? Peter Horsbøll Møller GIS Developer, MTM Geographical Information & IT COWI A/S Odensevej 95 DK-5260 Odense S. Denmark Tel +45 6311 4900 Direct +45 6311 4908 Mob +45 5156 1045 Fax +45 6311 4949 E-mail [EMAIL PROTECTED] http://www.cowi.dk/gis _______________________________________________ MapInfo-L mailing list MapInfo-L@lists.directionsmag.com http://www.directionsmag.com/mailman/listinfo/mapinfo-l _______________________________________________ MapInfo-L mailing list MapInfo-L@lists.directionsmag.com http://www.directionsmag.com/mailman/listinfo/mapinfo-l