Don't try this at home!

Adventures in WPS programming

Chris Wohlgemuth

About the presenter

What's this about?

Before you start

WPS programming cycle

Class installation

Hour clock Theater

Ooops! Hour clock instead of WPS.

Inevitable question...

Moment of truth

Do you have a desktop archive?

How to recover

How to recover 2

How to recover 3

"I have vermin to kill."

- The Bride -

Calling in the bug squashing squad

How to debug

Calling in the bug squashing squad

Watch out for

Programming techniques

Tips and tricks

Rules

"...some may be bent, some may be broken."

- Morpheus -

Rules and the WPS

Rule of thumb

If there is no SOM API for it or no method to use/override it's a bad idea.

(Look into the SOM headers for little gems ;-) )

Resources

Exception handlers

Catch exceptions!

See XWP for an implementation

...but XWP is GPL!

See CandyFolder for an implementation (BSD)

...or just get except3.zip from Hobbes.

Exception handlers

  TRY_LOUD(MODIFY_POPUP) {

    /* Some code */

  }
  CATCH(MODIFY_POPUP) {

    SysWriteToTrapLog("\nTrap in %s, file %s...", ...);

  } END_CATCH;
  

"I've seen things you people wouldn't believe..."

- Roy Batty -

Example - Lucide thumbnails

EA data not prepended with size info.

Example - Lucide thumbnails part 2

User installed replacement IO procedure which can't deal with memory files (in contrast to the IBM one).

Example - CWMM hogs resources

XWP kept every object ever touched locked thus wpUnInitData() was never called.

Example - Method not called

WPFolder eats the wpObjectReady() method call. The parent is not called.

Example - Weird parameters in method call

Investigation shows that the freshly created object is discarded somewhere in between the method calls and replaced by a new object behind our back.

Questions, remarks

The end

#netlabs on irc.freenode.net