Page 1 of 1

[Library] Invalid Memory Access While Calling DLL Function

Posted: Sun Jun 01, 2014 5:38 pm
by grabiller
Hi,

I'm a bit puzzled here, I'm trying to use the Assimp64.dll from PureBasic, and while I succeed to open the DLL and retrieve all the C functions, whenever I try to call any of those I get the following error:

Code: Select all

[ERROR] Invalid memory access. (write error at address XXXXXXXXXXXXX)
XX.. being the address of the function.

I'm using standard OpenLibrary() and GetFunction() and load the DLL functions through Prototypes as usual.

I've used ExamineLibraryFunctions() to be sure, and indeed I correctly get all the DLL function entries.

That said, the address I get are quite 'high', such as :
aiGetVersionMajor -> 0x7FEE818BDB0
aiGetVersionMinor -> 0x7FEE818BDA0

I can post a simple Purebasic example if needed, perhaps I'm doing something obviously stupid I don't see, although I'm quite used to import DLL functions.

Any idea what could be wrong here ?

Does this happened to someone else too ?

Re: [Library] Invalid Memory Access While Calling DLL Functi

Posted: Mon Jun 02, 2014 12:58 pm
by grabiller
My bad..

I was, indeed, doing something stupid: I had an unexpected code path that was closing the library before using it..