• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Passing NSPrintOperation* to CPP Function
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Passing NSPrintOperation* to CPP Function


  • Subject: Re: Passing NSPrintOperation* to CPP Function
  • From: KappA <email@hidden>
  • Date: Thu, 22 Sep 2011 09:17:36 -0400

Did you try to cast the parameter being passed so that it enforces the
definition - when calling the function?

m_bprinter->Setup((NSPrintOperation*)po);

Also, did you rename your .cpp file to .mm? (although that shouldn't really
matter much)...

And in the CPP header file, did you include the appropriate cocoa headers
for the "NSPrintOperation*" type?

As a workaround, you can always declare the CPP function in your class to
take a "void*" instead of "NSPrintOperation*" and then cast it back to a
"NSPrintOperation*" in the body of the function... and cast the "po" to a
"void*" when calling the CPP function...

Hope this helps.

Kappa

On Wed, Sep 21, 2011 at 11:10 PM, Jens Alfke <email@hidden> wrote:

> I think we’d need to see the actual code (or sections directly copied from
> it) to tell what’s going wrong.
> For example, the class declaration you provided wouldn’t work because
> Setup() isn’t declared as public, but I assume that’s just because you just
> typed in a couple of lines from it.
>
> —Jens_______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Fwd: Passing NSPrintOperation* to CPP Function (From: koko <email@hidden>)
 >Re: Passing NSPrintOperation* to CPP Function (From: Jens Alfke <email@hidden>)

  • Prev by Date: Error Recovery at close of document window
  • Next by Date: Re: Cannot quit TextEdit
  • Previous by thread: Re: Passing NSPrintOperation* to CPP Function
  • Next by thread: Equivalent of UITextField's textField:shouldChangeCharactersInRange:replacementString for NSTextField
  • Index(es):
    • Date
    • Thread