Page 2 of 2

Re: Possible problem calling DLL functions in Windows 7

Posted: Thu Nov 08, 2012 1:20 pm
by luis
The API only example by Danilo crash here too, but again moving the

filename$="text.xxg"
DeleteFile_(filename$)

before the

vx.l=LoadLibrary_("vfile.dll")

makes all work again.

DeanH wrote:I'll ask the guy who wrote it if he could recompile it.
See if you can convince him to put some ASSERT macros in the code to test for pointers validity, system functions return values and so on. I'm convinced this will help immensely to catch the problem quickly, if the asserts are positioned properly.

Then ask him for a "debug" (with the asserts) and a "release" version.
With debug I mean a release version with the asserts, not a debug build with debug code inside and the asserts.

Re: Possible problem calling DLL functions in Windows 7

Posted: Thu Nov 08, 2012 11:33 pm
by DeanH
I'd like to thank you for have a look at this. As I said, it drove me nuts and I've spent way too many hours on it. So, it looks as if the problem involves a change to the way Windows version 6 (Vista, W7 & Server 2008) does memory allocation as opposed to previous versions and that functions within the DLL itself may not be checking for incorrect assignments or allocations. As I indicated at the start, I did not feel it was a PureBasic problem as such but something with the operating system. I happen to be using PureBasic, though, extensively. Again, thank you.