6 Replies Latest reply: Jun 19, 2011 10:30 PM by dheeraj_c RSS

    Photoshop displaying a warning in console.

    dheeraj_c Community Member

      Hi All,

                I'm trying to display a carbon dialog using dissolve plugin. I create a carbon dialog and then i try to add Cocoa view to carbon window. I get a warning when I try to create the view : "Adobe Photoshop CS5[4016:a0f] HICocoaView must be used in a compositing window"

       

      The Cocoa view is not visible in Carbon window (may be because of this warning because when I tried this code as separate application the code works fine and the cocoa view is shown in carbon window).

       

      Here is the code:

       

              WindowAttributes attributes = kWindowStandardDocumentAttributes |
              kWindowStandardHandlerAttribute | kWindowInWindowMenuAttribute | kWindowResizableAttribute;

       

              CreateNewWindow (kDocumentWindowClass,
                               attributes,
                               &r, &wrapperWindow);
             
              HIViewRef rootView = HIViewGetRoot( wrapperWindow );
             
              Rect              contentRect;
              HIViewRef           view;
              HIRect              outRect;
             
              SetRect (&contentRect, 0,  0, 500, 500);
                     
              CocoaView* cocoaView = [[CocoaView alloc] init];     //CocoaView is derived from NSView
             
              err = HICocoaViewCreate(cocoaView, 0, &view);    //Warning is thrown after the execution of this line.
             
              err = HIViewGetBounds(rootView, &outRect);
              HIViewSetVisible(view,TRUE);
             
              err = HIViewAddSubview(rootView, view);

       

              HIViewApplyLayout( rootView );

       

       


      Can anyone tell me the reason for the warning and the way to fix the warning?

       

      Thanks,

      Dheeraj