Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Message.PowerObjectParm Null object ref??????

Status
Not open for further replies.

kaul125

Programmer
Jan 29, 2002
87
US
I'm using the Message.PowerObjectParm object and when my structure is returned(by using the closedwithreturn() function, I'm getting a null object reference.

Here is my code:

window one:
OpenWithParm(window_two,i_structure_one)
i_structure_two = Message.PowerObjectParm
ll_start = i_structure_two.sl_start_time_slot

Window two:
i_structure_two.sl_start_time_slot = ll_first_highlighted_row
i_structure_two.sl_end_time_slot = ll_last_highlighted_row
i_structure_two.sd_appt_date = id_appt_date

CloseWithReturn(parent,i_structure_two)

When I'm in debug mode, window two script does populate the structure. So I know that it is not null. However, when I return to window one script, the message object is empty/null and it causes an null object ref when I try to access it.

Why is the object empty when I return to window one?

Thanks,

Keith
 
I assume it also doesn't work outside of debug (just asking). Couple of questions...
1) window2 is a response window (should be for CloseWithReturn)
2) Where are the structures instantiated? (local, instance, ?)

I've had luck with using an application structure, instantiated locally in the script which does the OpenWithParm, and the CloseWithReturn return a reference to the structure defined as an instance variable in the response window.

You could try this... instead of CloseWithReturn, set the Message.PowerObjectParm to the structure and just perform a Close.
 
Answers to your questions:
1. Your assumption is correct: it doesn't work outside of debug.
2. Yes, window2 is a response window
3. They are instantiated as instance variables in the window as: s_two i_structure_two

I will try your suggestions and let you know.

Thanks.
 
Keith -

Check to see if you are closing window 2 via the control menu (the little "X" box in the upper right-hand corner). This will cause the CLOSE event to fire without processing any CLOSE command button in which you might have code.


Olan
 
What I did to get this to work:

I followed your suggestion by setting the Message.PowerObjecParm = my_structure and perform a regular close

Response to last response:
I closing the window with the 'close' commandbutton and not the control menu.

Thanks,
Keith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top