RE: EXW Crashes
francis at gmx.co.uk wrote:
> I'm having memory troubles
>
> At the bottom is code which replicates a common error I've been,err,
> causing
> after trying to implemenet Dialog boxes within euphoria.
>
> The for loop after WM_INITDIALOG causes an error in "EXW.EXE: Invalid
> instruction[arbritary memory address] tried to read from #FFFFFFFF which
> could not be read from." or sometheing similar to that. If I print out
> the
> allocate result each time in the for loop it never fails and sets itself
> to
> #FFFFFFFF, I thought it returned 0 if it failed anyway. It always fails
> in
> the second round of the loop too.
>
> ARGH! I've tried many situations like code like this but it always
> causes an
> exception in EXW.EXE and is always ONLY after a modal dialog is created
> by
> DialogBoxIndirectParam() or modeless by CreateDialogIndirectParam().
> from
> user32.dll. Putting this stuff into
>
> atom pstr
> function DlgProc(atom hwnd,atom iMsg, atom wParam, atom lParam)
>
> if iMsg = WM_INITDIALOG then
>
> for i = 1 to 10 do
> pstr = allocate(100)
> poke(pstr,sprintf("%d",i))
> c_proc(pSendMessage,{hwnd,WM_SETTEXT,0,pstr})
> free(pstr)
> end for
>
> return 0
> elsif iMsg = WM_CLOSE then
> c_proc(xEndDialog,{hwnd,0})
> end if
>
> return 0
> end function
>
francis:
First it is a good idea to initialize any structure or
storage to all zeros.
Second any sz string MUST end with a NULL or Zero
Bernie
|
Not Categorized, Please Help
|
|