nsIDOMCanvasRenderingContext2d embedding in 1.9.2 ?

"[email protected]" <[email protected]>
Newsgroups gmane.comp.mozilla.devel.embedding
Organization NovaDSP
Message-ID <[email protected]>
I'm extending my MozMFC example to handle rendering into a Win32 bitmap. 
I start with the following ...

     nsCOMPtr<nsICanvasRenderingContextInternal> context;
     context = 
do_CreateInstance("@mozilla.org/content/canvas-rendering-context;1?id=2d", 
&rv);
     if (!(NS_SUCCEEDED(rv) && context))
     {
         return 0;
     }
     context->SetDimensions(clientRect.Width(),clientRect.Height());


setDimensions() internally calls InitializeWithSurface(NULL, surface, 
width, height);

Sadly InitializeWithSurface() triggers the following assertion:

NS_ASSERTION(!docShell ^ !mCanvasElement, "Cannot set both docshell and 
canvas element");

Where am I going wrong here? Should there be some additional prior 
initialization of the context?  both docShell and mCanvasElement are null.

Thx++

Jerry
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.