I have a rather peculiar problem, which I hope somebody could give some advice.
First, when I run it in debugger, it works OK, but trying to run the compiled program causes a GPF.
However, I have been able to trace the statement where program crashes although I don't know why.
I try to explain what happens.
I have a global array of UDT's.
Program saves the information in this array to disk using following code
Then it is read back in following code
After this following code is executed. Program crashes at CreateWindowEx (at least it never gets executed).
The problem is somehow connected to the reading of data back from the disk because if I change line
WHILE NOT EOF(hFile)
to
WHILE lIndex<10
everything works again. I see that my original code tries to read record number 10. Why it is doing it because I wrote only nine records to the disk. Has this something to do with the problem? I can't see how the CreateWindowEx could be involved here.
As I said in the beginning, the debugger is useless here because the original code works OK in debugger.
I certainly hope somebody can give me some advice.
TIA
Lasse Rantanen
[email protected]
First, when I run it in debugger, it works OK, but trying to run the compiled program causes a GPF.
However, I have been able to trace the statement where program crashes although I don't know why.
I try to explain what happens.
I have a global array of UDT's.
Code:
GLOBAL MyRec(1 TO 9) AS tagMYREC
Code:
... hFile = FREEFILE OPEN sFileName FOR RANDOM AS hFile LEN = SIZEOF(MyRec) FOR lIndex = 1 TO UBOUND(MyRec) PUT hFile, lIndex, MyRec(lIndex) NEXT CLOSE hFile ...
Code:
... hFile = FREEFILE lIndex = 1 OPEN sFileName FOR RANDOM AS hFile LEN = SIZEOF(MyRec) WHILE NOT EOF(hFile) GET hFile, lIndex, MyRec(lIndex) INCR lIndex WEND CLOSE hFile ...
Code:
GetClientRect hWndParent, rcl hWndList = CreateWindowEx( %WS_EX_CLIENTEDGE, _ $WC_LISTVIEW,"", _ %WS_VISIBLE OR %WS_CHILD OR %WS_BORDER OR %LVS_REPORT OR _ %LVS_EDITLABELS OR %LVS_SHOWSELALWAYS, _ 1, 1, rcl.nright - rcl.nleft- 2, rcl.nbottom - rcl.ntop - 2, _ hWndParent, _ %ID_LISTVIEW, _ hInst, _ BYVAL %NULL )
WHILE NOT EOF(hFile)
to
WHILE lIndex<10
everything works again. I see that my original code tries to read record number 10. Why it is doing it because I wrote only nine records to the disk. Has this something to do with the problem? I can't see how the CreateWindowEx could be involved here.
As I said in the beginning, the debugger is useless here because the original code works OK in debugger.
I certainly hope somebody can give me some advice.
TIA
Lasse Rantanen
[email protected]
Comment