always call it from the new() routine; otherwise the current canvas is undefined. You can store the pointer for later (an object's parent canvas is guaranteed never to change.)
hm ... if something like this would be documented some way, it might reduce my headaches when trying to explain this error ... i assume, this behaviour is the same for all canvas functions exported in m_pd.h? if so, a small comment in m_pd.h would definitely be useful ...
cheers ... tim