There are two ways to reproduce the crash:
1) Record a Macro that will Export a file to PSD with Transparency check set on in 'Convert To Bitmap' dialog.
Go to File -> Export a file to PSD and click export and set Transparency check set off in 'Convert To Bitmap' dialog.
Now run the macro. CorelDraw crashes.
2) Go to File -> Export a file to PSD and click export and set Transparency check set off in 'Convert To Bitmap' dialog.
Run the following script which sets the Transparency check on:
IVGStructExportOptionsPtr pVGStructExportOptionsPtr = m_pApp->CreateStructExportOptions(); pVGStructExportOptionsPtr->PutTransparent(VARIANT_TRUE); m_pApp->ActiveDocument->ExportEx( _T("C:\\Temp\\TestFile.psd"), cdrPSD, cdrAllPages, pVGStructExportOptionsPtr, nullptr ); pCorelExportFilterPtr->Finish();
CorelDraw crashes or exported file locked (with Transparency turned off)
Any Idea?
It wouldn't be the macro would it?
Once you go to File -> Export to PSD with Transparency turned off, running the macro will cause the crash.
Here is the macro with Transparency turned on:
Sub MacroTest() Dim expflt As ExportFilter Set expflt = ActiveDocument.ExportBitmap("C:\Temp\TestFile.psd", cdrPSD, cdrAllPages, cdrCMYKColorImage, 1255, 1678, 300, 300, cdrNoAntiAliasing, False, True, True, False, cdrCompressionNone) expflt.FinishEnd Sub
So, it's the macro, correct? Exporting using the Corel export dialog itself works correct?
Yes. This issue has not been resolved yet. Any suggestions?
Don't use the macro?
I am not using the macro. I am using automation - see my code above.
pVGStructExportOptionsPtr->PutTransparent(VARIANT_TRUE); //causes crashpVGStructExportOptionsPtr->PutTransparent(VARIANT_FALSE); //does not cause crash
//Export the documentVGCore::ICorelExportFilterPtr pCorelExportFilterPtr = m_pApp->ActiveDocument->ExportEx( _bstr_t(szFileName), VGCore::cdrPSD, VGCore::cdrAllPages, pVGStructExportOptionsPtr, pVGStructPaletteOptionsPtr );