none
Extensions possible with Non-Managed References? RRS feed

  • Question

  • I need to include an unmanaged DLL reference in a Small Basic extension to allow reading of a proprietary binary file format.  But when I call the method that calls the unmanaged method, the app blows up and reports "Could not load file or assembly".  Is what I am doing even possible? 

    Thanks.

    Friday, April 24, 2015 8:54 PM

Answers

  • Yes it is possible, but native (unmanaged) code needs both 32 and 64 bit versions depending on the client architecture (no AnyCPU in native) and the dlls must be located correctly which won't be handled by Small Basic so your extension code must do it.  The unmanaged code must usually be wrapped in CLR (C++) to access it.

    So when I use these I store both 32 and 64 bit dll versions as resources in the managed extension, then the extension extracts the required dll at run time and loads it (late binding) when a managed method needs it.

    Friday, April 24, 2015 9:22 PM
    Moderator