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!

DDE Problems

Status
Not open for further replies.

angoid

Programmer
Jan 22, 2004
13
GB
Hi all,

I'm getting strange whitebox system errors reporting "null object references" where they should not occur. The code is perfectly OK, and the errors are sporadic and not reproducible on demand.

The configuration is a PowerBuilder 8 application communicating with a "data currency server" - itself a PowerBuilder application.

When there is a slowness in the network (the only way I can emulate this is to introduce a delay in the data currency server), it seems as if the script calling the function continues after some kind of timeout. This results in the code ploughing on and then attempting to reference an object that somehow has not been set up yet.

A script calling a reposnse window (which should not continue until the response window has been responded to) is continuing before it should, and this is when those Null Object Reference errors are occurring - I added some logging to determine this.

I've come across an application property called DDETimeout, but setting this seems to have had no effect.

Is there a way to optimise the DDE communication, or otherwise catch these in order to prevent those errors?

Cheers.
 
Can you do an 'IsValid' check after the response window to at least present a more helpful error? (rather than the Null object....)
 
Thanks Imbalent

Unfortunately the very test for IsValid (or even IsNull) has no effect - I get the very same abort.

One of the dirty tricks I've tried is to set up an instance variable (called ib_nasty_kludgearound (!)) and initialise it to FALSE. It gets set to TRUE when the object that is null is instantiated.

If the script where the 'null object' is required tests this variable and discovers it to be FALSE, then I re-fire the event and exit. Keep doing this until I get TRUE.

This also fails(!) with precisely the same error.

It is as if there is a timeout somewhere that is coming into play with the result that script execuction is continuing, thus the code is sort of running wild.
 
Can you show the code for:

1. null-object declaration
2. Place, there you call responsewindow
3. DDE call in response window
4. "null object" initialisation
5. "null object"-isvalid test
6. place, there system error "null object references" occures

----------
gruss aus Deutschland
 
Angoid

I was reviewing this post in connection with another DDE error and wanted to advise that the DDE Timeout property IS editable and can prevent errors reaching your application.
If you set your LinkTimeout to a value of (-1) then this tells your control to wait the maximium time for a response from a DDE conversation.
I had an DDE call set to 50 (5 seconds) that errored due to the size of files it was handling. The amendment to (-1) allowed enough time within the DDE call to handle the larger files.
Thought that maybe useful.

Cheers
 
Angoid

I was reviewing this thread for another DDE issue.
The DDE Timeout property IS editable and can prevent errors reaching your application.
Set the LinkTimeout value to (-1) which tells the control to wait the maximum length of time for a response in a DDE conversation.
My app had a Timeout value of 50 (5 seconds) but received errors due to size of files it was handling. I changed the value to (-1) and the errors stopped.
Thought it might be useful to know.

Cheers
 
Hi all,

mbalent, curiously enough, even performing an IsValid caused a Null Object Reference on the object it was testing for validity! IsNull did the same thing.

LondonUnderpaid, I eventually found the setting to change the timeout and bumped it to an unrealistically high value - again and unfortunately to no avail.

I believe the customer is experiencing hardware issues and are getting a hardware upgrade in early 2005, and the situation is going to be re-assessed at that time.

Leyka, the issue has "gone dead" now with the customer so I'll leave it for now. However, the code is strewn out all over the place so trying to piece things together would not be an easy task. I didn't write the code myself - just maintaining it, so not necessarily written how I would have.

Thanks for all the help anyway!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top