|
Re: Pointers problem - Unable to dereference NULL pointer [message #57201 is a reply to message #57200] |
Thu, 06 December 2007 07:04  |
Romolo Politi
Messages: 6 Registered: December 2007
|
Junior Member |
|
|
On 6 Dic, 15:33, David Fanning <n...@dfanning.com> wrote:
> Romolo Politi writes:
>> The only thing that I don't understand is "why when I comple the
>> program whitout the run-time option it's all right?"
>
> See my follow-up article. My confidence is now VERY HIGH
> that this is a blocking vs. modal widget problem. :-)
>
>> the programmer errors are the only certain things in a program ;)
>
> Well, at least the tuition fund is safe. :-)
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
I read the article and I try to create the group leader widget in
modal mode, but it not works.
|
|
|
Re: Pointers problem - Unable to dereference NULL pointer [message #57204 is a reply to message #57201] |
Thu, 06 December 2007 06:33  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Romolo Politi writes:
> The only thing that I don't understand is "why when I comple the
> program whitout the run-time option it's all right?"
See my follow-up article. My confidence is now VERY HIGH
that this is a blocking vs. modal widget problem. :-)
> the programmer errors are the only certain things in a program ;)
Well, at least the tuition fund is safe. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: Pointers problem - Unable to dereference NULL pointer [message #57206 is a reply to message #57204] |
Thu, 06 December 2007 06:23  |
Romolo Politi
Messages: 6 Registered: December 2007
|
Junior Member |
|
|
> Well, then my next thought would be "That's not the pointer
> your program is complaining about." My main point is that
> when you are building run-time applications, you have to
> have enough error handling built in to locate errors when
> they occur. You seem to be hoping this is an IDL error.
> I'd be willing to bet the balance of the tuition fund
> (admittedly not so much now) that it is a programmer error. :-)
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
The only thing that I don't understand is "why when I comple the
program whitout the run-time option it's all right?"
the programmer errors are the only certain things in a program ;)
Cheers
Romolo
|
|
|
Re: Pointers problem - Unable to dereference NULL pointer [message #57207 is a reply to message #57206] |
Thu, 06 December 2007 06:17  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
David Fanning writes:
> Well, then my next thought would be "That's not the pointer
> your program is complaining about." My main point is that
> when you are building run-time applications, you have to
> have enough error handling built in to locate errors when
> they occur. You seem to be hoping this is an IDL error.
> I'd be willing to bet the balance of the tuition fund
> (admittedly not so much now) that it is a programmer error. :-)
You know, it just occurs to me that this is *exactly*
the kind of error you are likely to get when you call
a routine that is suppose to block at the command line.
For example, a pop-up dialog of some kind. Since there
*is* no command line in a run-time environment, if these
kinds of routines are not written as "modal" widgets (as
opposed to "blocking" widgets), then a null pointer
reference is entirely likely, since they will run through
their block.
Here is a reference to an article you might find illuminating:
http://www.dfanning.com/widget_tips/modal_blocking.html
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: Pointers problem - Unable to dereference NULL pointer [message #57208 is a reply to message #57207] |
Thu, 06 December 2007 06:10  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Romolo Politi writes:
> In may case the main program create the pointer, fill it, and then
> call the procedure for the widget creation.
> the data are writen in the source.
>
> wdg=ptr_new({id:0,set:0,cube:bytarr(5,5),band:0,res:0,flname : "",pre:
> 0,iddata:0,cmx:0,cmy:0,foc:0,circ:0})
Well, then my next thought would be "That's not the pointer
your program is complaining about." My main point is that
when you are building run-time applications, you have to
have enough error handling built in to locate errors when
they occur. You seem to be hoping this is an IDL error.
I'd be willing to bet the balance of the tuition fund
(admittedly not so much now) that it is a programmer error. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: Pointers problem - Unable to dereference NULL pointer [message #57213 is a reply to message #57208] |
Thu, 06 December 2007 05:17  |
Romolo Politi
Messages: 6 Registered: December 2007
|
Junior Member |
|
|
On 5 Dic, 19:00, David Fanning <n...@dfanning.com> wrote:
> Romolo Politi writes:
>> I used pointers to share variables between different procedures.
>> When I compile the project it's all right. If I export the project
>> as .sav there is the error "Unable to dereference NULL pointer".
>> Someone just encountred this problem?
>
> My guess would be that the pointer never got filled
> with data because the program couldn't find the data
> file. You are catching errors, and popping up a dialog
> message, right? So you would know if an error occurred
> in your program during runtime. The data file will,
> unless you are doing something special, have to be
> in the same location as the save file.
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
In may case the main program create the pointer, fill it, and then
call the procedure for the widget creation.
the data are writen in the source.
wdg=ptr_new({id:0,set:0,cube:bytarr(5,5),band:0,res:0,flname : "",pre:
0,iddata:0,cmx:0,cmy:0,foc:0,circ:0})
|
|
|
Re: Pointers problem - Unable to dereference NULL pointer [message #57311 is a reply to message #57213] |
Wed, 05 December 2007 10:00  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Romolo Politi writes:
> I used pointers to share variables between different procedures.
> When I compile the project it's all right. If I export the project
> as .sav there is the error "Unable to dereference NULL pointer".
> Someone just encountred this problem?
My guess would be that the pointer never got filled
with data because the program couldn't find the data
file. You are catching errors, and popping up a dialog
message, right? So you would know if an error occurred
in your program during runtime. The data file will,
unless you are doing something special, have to be
in the same location as the save file.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|