I have a very large program > 1500 lines I have been working on for a couple of
months. It is to be an example of lots of Aurora stuff.
After I loaded the latest update it is now crashing with the Windows 'I am sorry but your
program crashed' message. The code that appears to cause the crash is:
CStatic *m_staticID,*m_staticRECNO;
messagebox(0,"3.1 " + numtostr(m_count),"DEBUG");
m_staticRECNO->SetText(TrimLeft(NumToStr(m_count)));
It does the message box then crashes at the SetText line.
If I could figure out the debugger I might be able to tell more - it just gives me
Call stack
stockkeeper! <missing symbols>
stockkeeper! <missing symbols>
stockkeeper! <missing symbols>
USER32! GetDC + 109
USER32! PrivateExtractIconExW + 690
USER32! PrivateExtractIconExW + 254
USER32! DefDlgProcA + 34
USER32! GetDC + 109
USER32! GetDC + 335
USER32! GetParent + 364
USER32! GetWindowTextLengthW + 1351
USER32! CreateDialogIndirectParamAorW + 51
USER32! CreateDialogIndirectParamA + 27
stockkeeper! <missing symbols>
stockkeeper! <missing symbols>
stockkeeper! <missing symbols>
stockkeeper! <missing symbols>
stockkeeper! <missing symbols>
USER32! GetDC + 109
USER32! GetDC + 335
USER32! GetWindowLongW + 295
USER32! DispatchMessageA + 15
stockkeeper! <missing symbols>
stockkeeper! <missing symbols>
stockkeeper! <missing symbols>
kernel32! RegisterWaitForInputIdle + 73
Integer Registers
EAX: 0x00000000, EBX: 0x00000001
ECX: 0x7C91056D, EDX: 0x00000000
EDI: 0x009C20B8, ESI: 0x0042440D
ESP: 0x0012F648, EBP: 0x0012F65C
EIP: 0x0040861E, EFL: 0x00000246
CS: 0x001B, SS: 0x0023
DS: 0x0023, ES: 0x0023
FS: 0x003B, GS: 0x0000
FP Registers
ST0: -1.#IND000000000000
ST1: -1.#IND000000000000
ST2: -1.#IND000000000000
ST3: -1.#IND000000000000
ST4: -1.#IND000000000000
ST5: -1.#IND000000000000
ST6: -1.#IND000000000000
ST7: -1.#IND000000000000
Anyone help?
When you get <missing symbols> that means you have to make a debug build (project dialog->check debug build), that way it will be able to tell you more about the crash.
And if that code really appears how you have it, that means there is a null pointer dereference problem (or wild pointer if it's made on the stack [inside a sub])
This is the output with the debug turned on in the project.
Line 821 is the call to setupcontrols which has the indicated code.
Call stack
stockkeeper! StkkeprSetupControls + 145 File: C:\aurora\stocktrak\stockkeeper.src, Line: 1027
stockkeeper! StkkeprOnInitDialog + 997 File: C:\aurora\stocktrak\stockkeeper.src, Line: 821
stockkeeper! CDialogSetDefaultFont + 629
USER32! GetDC + 109
USER32! PrivateExtractIconExW + 690
USER32! PrivateExtractIconExW + 254
USER32! DefDlgProcA + 34
USER32! GetDC + 109
USER32! GetDC + 335
USER32! GetParent + 364
USER32! GetWindowTextLengthW + 1351
USER32! CreateDialogIndirectParamAorW + 51
USER32! CreateDialogIndirectParamA + 27
stockkeeper! CDialogShowDialog + 432
stockkeeper! SKWindowOnMenuPick + 3656 File: C:\aurora\stocktrak\stockkeeper.src, Line: 662
stockkeeper! CWindowOnCommand + 426
stockkeeper! CWindowWndProc + 960
stockkeeper! CWindowDestroy + 1980
USER32! GetDC + 109
USER32! GetDC + 335
USER32! GetWindowLongW + 295
USER32! DispatchMessageA + 15
stockkeeper! WAIT + 1052
stockkeeper! main + 840 File: C:\aurora\stocktrak\stockkeeper.src, Line: 734
stockkeeper! main + 48
kernel32! RegisterWaitFo
rInputIdle + 73
Integer Registers
EAX: 0x00000000, EBX: 0x00000001
ECX: 0x7C91056D, EDX: 0x00000000
EDI: 0x009F20B8, ESI: 0x0045240D
ESP: 0x0012F638, EBP: 0x0012F64C
EIP: 0x0042E61E, EFL: 0x00000246
CS: 0x001B, SS: 0x0023
DS: 0x0023, ES: 0x0023
FS: 0x003B, GS: 0x0000
FP Registers
ST0: -1.#IND000000000000
ST1: -1.#IND000000000000
ST2: -1.#IND000000000000
ST3: -1.#IND000000000000
ST4: -1.#IND000000000000
ST5: -1.#IND000000000000
ST6: -1.#IND000000000000
ST7: -1.#IND000000000000
And where are you setting m_staticRECNO?
As your code is written it would be a null pointer.
agree, I am sure Rock Ridge Farm forgot to preset the m_staticRECNO pointer,
you have only two local variables, and the stack frame is clean: (vc6 view) 82: ÂÃ, Ã‚Ã, Ã‚Ã, m_staticRECNO->SetText(TrimLeft(NumToStr(1)));
lea ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, eax,[ebp-4] ÂÃ, ;// eax = &m_staticRECNO
mov ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, edx,eax ;// edx = &m_staticRECNO&
mov ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, edx,dword ptr [edx] ;//edx = m_staticRECNO, also null, if stack is clean
mov ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, eax,edx ;// eax = null
mov ÂÃ, Ã‚Ã, Ã‚Ã, Ã‚Ã, edi,dword ptr [eax] ; // read from address zero goes here
your eax and edx is null, also m_staticRECNO must be null
in Stkkepr::OnInitDialog()
m_staticRECNO = GetControl(IDS_RECNO);
In the window declaration:
mainwin.AddControl(CTSTATIC,"REC_NO",200,300,70,15,0x50000000,0x0,IDS_RECNO);
So I think it is assigned.
Without seeing more of the code I can't help much. Feel free to post it in the developers section.
I moved the getcontrol statement to just before I used the Recno var and now it
works. Strange - this worked till I loaded the new release.
That's what constructors are for. Set all of your pointer variables to NULL and you'll get a crash right away if you dereference them without assigning them first.
You may have inadvertantly moved the GetControl statement.
This does not work
m_staticRECNO = GetControl(IDS_RECNO);
m_staticID = GetControl(IDS_RECID);
m_buttonUpdate = GetControl(IDB_UPDATE);
m_buttonNext = GetControl(IDB_NEXT);
m_buttonPrev = GetControl(IDB_PREV);
CenterWindow();
//open our database
if(OpenDatabase() = 0)
return false;
SetupControls();
but if I move the getcontrol assignments to the setupcontrols routine it works?????
Stop making me guess ;) I can't see through your monitor and look at your code.
Please post the complete source code in its entirety in the developers center. It looks like your trying to modify my AddressBook sample to do something else?
OK I will post it later tonight.
It is to large to post directly.
I am having problems inserting as a .zip file.
How do I add a .zip file?
It does not seem to like it as an attachment.
Larry
what os are you using?
Larry
XP
Try to upload to any free file hosting service: www.rapidshare.de (100MB) www.megaupload.com (200MB)...
No registration, just two clicks :)
I am trying to attach it to a message.
I have it at my ISP.
In xp you should be able to right click on the file;
Select the 'send-to' option
select the 'compressed' option
that should create a zip with the same name as the file you want to zip.
then attach the zipped file to your post
Larry
You attach to a message by selecting "browse" in additional options and selecting a LOCAL file, on your drive. The forum downloads and attaches it to the message.
I fyou have it on your ISP you can either just post the link, or download it your PC first before attaching.