gambit47 wrote:The other possibilty, since you are importing the function from a DLL, is that you have probably used the wrong calling convention in your funkcijah type and are thus mismanaging the stack, where each call of the function is pushing parameters on the stack that the function is not clearing correctly on exit.
That probably is the case, because, when i use included .h file for this code, it works fine, and when i use a static .dll file made by builder, it also works fine. The problem probably is with the calling of the .dll this way it is done here.
arisme wrote:Is the error thrown after 51315 executions of the whole of the code you posted, or after 51315 calls to function k()?
The error occurs after 51315 function calls.
arisme wrote:Are you working in C++Builder? (i.e. Can you run in debug mode, apply breakpoints to selected statements, and then step through the code inspecting values?)
Yes, i'm using c++ builder and i can run in debugging mode, but as far as i've checked the values of gg and og are ok all the time, it must have something to do with the wrong cll of dll.
arisme wrote:Idle curiousity, "funkcija" - Latvian? Lithuanian?
Its Lithuanian. Pretty close call, you must have met some of our people. I was too lazy to translate the default name in the code

Here is the beginning of the .dll which is compiled and used when the error occurs:
- Code: Select all
#include <windows.h>
BOOL WINAPI DllMain (HANDLE hModule, DWORD dwFunction, LPVOID lpNot) {return TRUE;}
_declspec (dllexport)
// -active visi
void funkcija(char *gg,char *og,int in,int on,int *gerai)
{.....
}