Accessing DLL in Windows


I updated Xojo from 2015 r2 to 2016r1. Now I have the problem to access DLL in Windows. I placed them in the application folder, Libs and resources. But never they will be accessed. For checking I used the same Source and compiled it with 2015r2. And voila all works fine.

Can someone give me a hint what I have to change to use the DLLs Thank you very much.

What do your Declares look like? In that vein I like using Declare rather than Soft Declare often because then I know at compile-time whether the references are correct or not.

I don’t see how any changes in Xojo would change how your Declares reference things, and AFAIK the standard way has always been to place them alongside your .EXE. So it should show as:

#if DebugBuild Then Declare Function MyDLLFunc Lib "@executable_path\\..\\..\\DLLNameWithoutExt" () As Integer #else Declare Function MyDLLFunc Lib "DLLNameWithoutExt" () As Integer #endif

At least that’s how I do it and it works.

[quote=262106:@Garth Hjelte] Declare Function MyDLLFunc Lib “@executable_path\…\…\DLLNameWithoutExt” () As Integer

@executable_path is specific to OS X. As long as the DLL is next to the executable, all that needs to be done is specify the name.


meanwhile I tested an absolute path, too. But this don’t work, too.

My Declaration is for example:

Soft Declare Function EinstellungLesen  Lib "ericapi" Alias "EricEinstellungLesen" ( Name As CString, RueckgabePuffer As CString) As Int32

Before I use it, I set the path Variable to the folder with the dll. This works with Xojo 2015r2. But I also tried to move the DLL to the Libs path of my program and to the program folder. There is no difference.

Also “IsFunctionAvailable” return always false.

I have absolute no idea why this doesn’t works any more.

Did you solve this one ?

No, I tried some workarounds but no one works. Today I wrote an error report. Hope that Xojo will fix it or give me a solution.

Have you checked that the dll’s and exe are both 32 or 64 bit? The project might have changed the setting when moving to 2016 r1

Booth are 32 Bit. I’m sure because I can debug it.