
Problem calling DLL writen in VC 5.0 from VB 5.0
Hi,
I have written my DLL in VC 5.0 for my VB 5.0 application. I faced so
funny problem. In my program I wanted to call the DLL in four nested for
loop about 4620 times. If I hard coded the number of the time the for loop,
then I can call the DLL for about 100 times without any problem or erro
come out. Then if I used the value input from the user from sliding bar
which is in percentage of the total amount of the time the DLL to be
called, I multiply the percentage with the total amount which is 4620 and
get the integer of it. And when I try to run the DLL the number of the
times the user specify I can only run the DLL for 20-25 times only and
error occur.
The error is sa follow:
Mircosoft Visual C++ debug library
Debug Error!!
Program D:\VB5\Vb5.exe
DAMAGE: after Normal block (#321) as 0x01CD0CD0
Press retry to debug the application.
When I press the retry button the following error come out:
This program has performed an illegal operation and will be shut down.
I click on the details button and the following details is given:
VB5 caused an exeption 03H in module SPEECH.DLL at 014f:100005df0 and all
the register value and other stuff.
When I try to debug it, Visual C++ is started and it bring to me to the
function called void __cdecl _free_dbg_lk in the file calledDbgheap.c and
it show a message like this "User breakpoint called from code at
0x10005def".
In the function is have this code :
if (!CheckBytes(pbData(pHead) + pHead->nDataSize,
_bNoMansLandFill, nNoMansLandSize))
_RPT3(_CRT_ERROR, "DAMAGE: after %hs block (#%d) at
0x%08X.\n",
szBlockUseName[_BLOCK_TYPE(pHead->nBlockUse)],
pHead->lRequest,
(BYTE *) pbData(pHead));
}
there is an arrow point to the last line of the code (BTYE) .....
I am not sure what is wrong with it. Can only body please help me? Thanks
for the time. Why is this happending? What cause it to happen? How can I
fix this problem? What is the exception 03H mean? Which part of the program
I need to change? Is it in VB or in the DLL?
--
Keat Jau
Final year Computer Engineering student at
University of Newcastle