Hi,

I am writing code for a project that makes numerous calls to a .dll written in C++.
I have come across a strange problem where the app behaves differently when running from the compiled .exe to when running from the project.

I'm calling the function from the .dll

Code:
Private Declare Function HaxAnim_getFrameForStage Lib "HaxMio.dll" (ByVal haxAnim As Long, ByVal Stage As Integer) As Integer
I realise that this is pretty meaningless to anyone but me, as I'm the only person with the dll!!

The problem I'm having is that if I run from within VB and send meaningful values to haxAnim and Stage, I get -1 returned (which means there is an error - it should always return an Integer greater than 0). However when I run it from the compiled .exe the function returns the expected value.

The main problem is that I can't debug the .dll in C++, because I can only debug the .dll when I run the VB project from an executable, and because the executable is working fine, that's no help!

I'm just wondering if anyone has any ideas why running a project from VB would get different results to running the .exe. Surely they should be exactly the same???

If anyone has any suggestions to why this is happening, it would be much appreciated.

thanks

Paul