• 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
Fwd: Passing NSPrintOperation* to CPP Function
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fwd: Passing NSPrintOperation* to CPP Function


  • Subject: Fwd: Passing NSPrintOperation* to CPP Function
  • From: koko <email@hidden>
  • Date: Wed, 21 Sep 2011 20:56:25 -0600

I forgot to send this to the list.


Begin forwarded message:

> From: koko <email@hidden>
> Date: September 21, 2011 8:50:29 PM MDT
> To: Jens Alfke <email@hidden>
> Subject: Re: Passing NSPrintOperation* to CPP Function
>
>
> On Sep 21, 2011, at 8:45 PM, Jens Alfke wrote:
>
>>
>> On Sep 21, 2011, at 7:34 PM, koko wrote:
>>
>>> class BPrinter
>>> {
>>> void		Setup(NSPrintOperation* pOperation);
>>> };
>>
>> How did you declare NSPrintOperation in this header?
>
> #import <Cocoa/Cocoa.h>
>>
>>> in my .cpp file (compiled as cpp.objcpp)
>>>
>>> void BPrinter::Setup(NSPrintOperation pOperation)
>>
>> You mean NSPrintOperation* pOperation, right? Else it wouldn’t compile.
> Yes, sorry that was a typo
>>
>>> Now in my Cocoa view .m
>>>
>>> 	NSPrintOperation *po = [NSPrintOperation printOperationWithView:self];
>>> 	m_bprinter->Setup(po);
>>
>> This is compiled as Objective-C++?
>
> Yes
>>
>>> and I get the error:
>>>
>>> no matching function for call to 'BPrinter::Setup(NSPrintOperation*&)
>>> I am confused by this ... why does the compiler think the signature is
>>> (NSPrintOperation*&) when clearly it is (NSPrintOperation*)
>>
>> Red herring — it just uses an & because the parameter is type-compatible with reference parameters.
>> Did you #include the C++ header in this source file?
> Yes
>>
>> —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

  • Follow-Ups:
    • Re: Passing NSPrintOperation* to CPP Function
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Re: Equivalent of UITextField's textField:shouldChangeCharactersInRange:replacementString for NSTextField
  • Next by Date: Re: Passing NSPrintOperation* to CPP Function
  • Previous by thread: Re: Passing NSPrintOperation* to CPP Function
  • Next by thread: Re: Passing NSPrintOperation* to CPP Function
  • Index(es):
    • Date
    • Thread