Could not load...

  1. ‹ Older
  2. 8 weeks ago
    Edited 8 weeks ago

    Thanks Norm, that didnt work. Its not an IDE plugin, its an external 3rd party .dll that does some data manipulation. The function are all experted as C in dep walker. I have hard pathed the Declares;
    Declare Function Initdll Lib "c:\XojoLibs\Plugin.dll" () As Integer
    since the initdll function returns a 1 or 0.

    result = Initdll()

    I get the "Function not found" rte, and deeper msg, "Could not load initdll from c:\XojoLibs\Plugin.dll" which seems like Im doing it right...

  3. Norman P

    May 28 Pre-Release Testers, Xojo Pro www.great-white-software.com/b...

    ah didn't realize you're trying to load it manually

    double check exported names match case etc
    probably the path to it as well

    quite honestly you might put the dll next to the exe when you debug and use

    soft Declare Function Initdll Lib "Plugin.dll" () As Integer  

    soft because the runtime wont try to load the dll until this code is somehow run
    and putting it next to the exe to eliminate the possibility that loading it frmo that path is whats faling
    dlls next to the exe should work no matter what

  4. Edited 8 weeks ago

    Well, I tried the soft decalre and putting it next to the Xojo exe and that didnt work. I tried also a break on the return call that soft declares it, and then pasting a copy of the dll into the debug application folder at run time (since it only exisits at that time) and that also failed with the same errors. Im thinking theres something wrong with the exports in the .dll. Is there any such "dummy" dll out there that I could load in this manner to know the process is correct?

    Or were you referring to another exe Norm?

  5. Norman P

    May 28 Pre-Release Testers, Xojo Pro www.great-white-software.com/b...

    Yeah putting it right next to the exe you're about to debug

    If the dll is there by the time you get to the soft declare & its not loading I'd think there's some other issue

    I'm just not sure what assuming things are all properly declared entry points for a DLL
    they use the right declspec ?
    __declspec(dllexport) rest of the function decl ?????

  6. Tim J

    May 28 Pre-Release Testers, Xojo Pro Dehydrating in AZ

    No one's asked at this point, but is the DLL written by you to be turned into a Xojo Plugin, or is it a normal DLL that has an API that allows it to be used in VC++ apps?

  7. Derk J

    May 29 Pre-Release Testers, Xojo Pro

    @Sean A @Derk J - what executable? I am just debugging so far. Do you know where it should go for debugging? I tried just a folder in 'c:\xojolibs\lib.ddl" and hard code loading to that path but the same error comes up

    CopyFileStep add it to pre-build settings in the app parent folder on windows systems

  8. Derk J

    May 29 Pre-Release Testers, Xojo Pro

    Ooh and, .net dlls won’t work with xojo. You need native dlls (such as c, c++)

  9. 7 weeks ago

    Hi Tim - thank you for that. It is the latter; a normal .dll that allows it to be used in C/C++ apps. The "sdk" suggests using visual studio, which obviously I do not want to do. I did open it in the dependancy walker and can see C and C++ exports.

    @Derek - thank you also. This is a "normal" .dll. I am wondering now does it need to be AciveX/COM compliant? Is thart whats wrong?

  10. Norman P

    Jun 5 Pre-Release Testers, Xojo Pro www.great-white-software.com/b...

    it shouldnt but you can only load C exports
    C++ ones require runtime support that wont be present

  11. Thanks Norm. I am not sure why its not working then. I can see the C exports in DepWalker. I can also see the C++ exports - that wouldnt cause a problem would it?

  12. Norman P

    Jun 5 Pre-Release Testers, Xojo Pro www.great-white-software.com/b...

    Dunno to be honest
    But if you open debug view or something and run your app I dont know if that would show dll loading errors
    I'm sure there has to be one of the many tools available that would show you if there were

  13. Andrew L

    Jun 5 San Francisco, CA, USA

    Can you share the DLL file?

    DLL function names are case sensitive; maybe it's supposed to be InitDll, InitDLL, etc.

  14. @Derek - I tried creating the build CopyFileStep and placed it under the windows build setting per the docs, added my .dll and then set the "applies to" to both "Both" and "Debug" and I get an error, "The script 'CopyDll' cant copy files to the destination in a pre build step. The destination does nto exist yet. This step will not be executed." Wierd, re reading as I must have something wrong...also now getting an update and second try wont let me move the CopyFileStep from Contents to BuildSettings. arghh.

    @Andrew - thank you for the offer but it has some unprotected IP in it. I am copying the calls from the export list in the header file and have compared the cases to the DepWalker exports - one can copy the name right outta there and paste into xojo. So Im sure its not a case issue.

  15. Norman P

    Jun 5 Pre-Release Testers, Xojo Pro www.great-white-software.com/b...
    Edited 7 weeks ago

    @Sean A @Derek - I tried creating the build CopyFileStep and placed it under the windows build setting per the docs, added my .dll and then set the "applies to" to both "Both" and "Debug" and I get an error, "The script 'CopyDll' cant copy files to the destination in a pre build step. The destination does nto exist yet. This step will not be executed." Wierd, re reading as I must have something wrong...also now getting an update and second try wont let me move the CopyFileStep from Contents to BuildSettings. arghh.

    Move the copy step after the one that says "Build" so its a post-build step
    And make sure you configure things to copy it right next to the exe itself

  16. @Norm, that gets it building, thanks for that. Seems so obvious now. However, it still isnt working giving the Func not Found/Could Not Load error...

    Does the DLL have to be ActiveX/COM compliant?

    I bought Eugene's ebook and reading but still am not sure whats going on here...

  17. Norman P

    Jun 5 Pre-Release Testers, Xojo Pro www.great-white-software.com/b...
    Edited 7 weeks ago

    nope
    just needs to be a dll that can be loaded using LoadLibrary on Windows or dl_open on macOS and Linux
    under the hood thats what Xojo calls

  18. Andrew L

    Jun 5 Answer San Francisco, CA, USA

    It might be a 64-bit DLL and you're building a 32-bit app (or vice versa).

  19. Norman P

    Jun 5 Pre-Release Testers, Xojo Pro www.great-white-software.com/b...
    Edited 7 weeks ago

    ah good thought ... never thought of that possibility but that would do it was well

  20. Christian S

    Jun 5 Pre-Release Testers, Xojo Pro, XDC Speakers Germany

    Dependency Walker would show a 32/64 bit mismatch as well as a missing DLL referenced.
    We often find DLLs which relay on some other DLL or a specific Visual Studio runtime version.

  21. Some of all of the above - for sure all very helpful, thank you!

or Sign Up to reply!