I’m doing a bit of 64bit testing. The following code fails for 64bit
[code]'get a print session
dim thePrintSession as CPMPrintSessionMBS = NewCPMPrintSessionMBS
if thePrintSession = nil then Return
'get default page format and print settings and attach it to the print settings
dim thePageFormat as CPMPageFormatMBS = NewCPMPageFormatMBS
if thePageFormat = nil then Return
dim thePrintSettings as CPMPrintSettingsMBS = NewCPMPrintSettingsMBS
if thePrintSettings = nil then Return
thePrintSettings.JobName = NewCFStringMBS(theSubject)
thePrintSession.DefaultPageFormat thePageFormat
thePrintSession.DefaultPrintSettings thePrintSettings
'show the print dialog
if not thePrintSession.PrintDialog(thePrintSettings, thePageFormat) then return[/code]
with an UnsupportedOperationException in the last row. As far as I can see this is directly from the examples. Is this a bug or is there a newer class to use?
El Capitan, Xojo 2017r1, MBS 17.2.
The same code makes a hard crash in High Sierra + 32bit + MBS 17.3. That looks like the problem you had fixed for 17.3pr7:
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 com.apple.GeoServices 0xa3884182 initCNPostalAddressStreetKey() + 47
1 com.apple.GeoServices 0xa3911a8c _GLOBAL__sub_I_GEOAddressObject.mm + 54
2 dyld 0x021af502 ___ZN16ImageLoaderMachO18doModInitFunctionsERKN11ImageLoader11LinkContextE_block_invoke + 34
3 dyld 0x021991ed dyld3::kdebug_trace_dyld_duration(unsigned int, unsigned long long, unsigned long long, void () block_pointer) + 210
4 dyld 0x021af450 ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) + 422
5 dyld 0x021af659 ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) + 59
6 dyld 0x021aa4e8 ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 350
7 dyld 0x021aa472 ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 232
8 dyld 0x021aa472 ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 232
9 dyld 0x021aa472 ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 232
10 dyld 0x021a94b8 ImageLoader::processInitializers(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 104
11 dyld 0x021a953b ImageLoader::runInitializers(ImageLoader::LinkContext const&, ImageLoader::InitializerTimingList&) + 65
12 dyld 0x0219d4a2 dyld::runInitializers(ImageLoader*) + 71
13 dyld 0x021a622c dlopen + 557
14 libdyld.dylib 0xa75a8a85 dlopen + 81
15 com.apple.CoreFoundation 0x9376fcab _CFBundleDlfcnLoadBundle + 155
16 com.apple.CoreFoundation 0x9376fb06 _CFBundleLoadExecutableAndReturnError + 598
17 com.apple.CoreFoundation 0x937826d5 CFBundleLoadExecutable + 21
18 com.apple.CoreFoundation 0x937a7f2f CFBundleGetFunctionPointerForName + 47
19 com.apple.print.framework.Print 0x9320e94b PJCPrintDialog + 169
20 com.apple.print.framework.Print 0x9320ef5e sessionPrintDialog(OpaquePMPrintSession*, OpaquePMPrintSettings*, OpaquePMPageFormat*, unsigned char, unsigned char*) + 166
21 com.apple.print.framework.Print 0x9320eeb3 PMSessionPrintDialog + 28
22 MBS_MacOSXCG_CarbonPrintManager_Plugin_19341.dylib 0x06de5a68 PrintDialog(REALobjectStruct*, REALobjectStruct*, REALobjectStruct*) + 88
23 com.mothsoftware.mailarchiverx 0x0022dba3 CPMPrintSessionMBS.PrintDialog%b%ooo + 104
24 com.mothsoftware.mailarchiverx 0x00ef1a17 reportPrinter.DoCarbonPrint%%oo + 1041
25 com.mothsoftware.mailarchiverx 0x00ef9292 reportPrinter.Notify%%osv + 1190
26 com.mothsoftware.mailarchiverx 0x01667c28 NotificationCenter.Post%%oss + 907
27 com.mothsoftware.mailarchiverx 0x01669afa NotificationManager.Post%%ss + 138
28 com.mothsoftware.mailarchiverx 0x017aabcc CCPrint.CCPrint.HTMLViewer1_DocumentComplete%%o<CCPrint.CCPrint>os
Did you read the message?
Carbon Print Dialog is not supported for 64-bit.
Please use NSPrint* classes.
Ah, the PMSessionPrintDialog loads a bundle for the dialog and crashes.
But in Apple’s code, I guess.
The webpage says: “Works only in Carbon Stuff and can only be used with CGContext which works only on Mac OS X.” Since there hasn’t been any Carbon Stuff for a while I wasn’t sure if this applies to 64bit or not. Also there is no mention of NSPrint in the Printing topic. The search is really frustrating. I only get links to pdfs.
Do you want me to open the bug for Apple or do you want to do this yourself?
How hot is in Phoenix? I don’t think we had more than 15 degrees here today.
This text is old and relays to it not working on classic Mac OS.
Carbon GUI is not available on 64-bit, but maybe under the hood Apple uses Cocoa.
Sometimes I love software. Not even the class hierarchy html file had anything with NSPrint. But I found any example. Just to have it crash on High Sierra, too, with the same crash info.
see
http://monkeybreadsoftware.net/class-nsprintoperationmbs.shtml
Class hierarchy only lists classes with sub/super classes.
Pretty please:
-alphabetic sorting of topics
-cocoa printing belongs to printing
And please do a search that doesn’t rely on Google. That drives me nuts.
I split a few topics into two as they got too big.
Will sort them. Sorry.
now sorted:
http://monkeybreadsoftware.net/themes.shtml
Was not sorted as I put the entries in dictionary to remove duplicates but forgot to sort them before output.
That’s much better. Thanks!