Chilkat HOME Android™ Classic ASP C C++ C# Mono C# .NET Core C# C# UWP/WinRT DataFlex Delphi ActiveX Delphi DLL Visual FoxPro Java Lianja MFC Objective-C Perl PHP ActiveX PHP Extension PowerBuilder PowerShell PureBasic CkPython Chilkat2-Python Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ Visual Basic 6.0 VB.NET VB.NET UWP/WinRT VBScript Xojo Plugin Node.js Excel Go
(MFC) Extract Files from MIMEExtract files from a MIME message.
#include <CkMime.h> #include <CkStringArray.h> void ChilkatSample(void) { CkString strOut; // This example requires the Chilkat API to have been previously unlocked. // See Global Unlock Sample for sample code. CkMime mime; // Load a MIME document from a file: // (.mht and .eml files contain MIME). bool success = mime.LoadMimeFile("mst.mht"); if (success == false) { strOut.append(mime.lastErrorText()); strOut.append("\r\n"); SetDlgItemText(IDC_EDIT1,strOut.getUnicode()); return; } CkStringArray *sa = mime.ExtractPartsToFiles("/temp/mimeParts"); if (mime.get_LastMethodSuccess() == false) { strOut.append(mime.lastErrorText()); strOut.append("\r\n"); SetDlgItemText(IDC_EDIT1,strOut.getUnicode()); return; } int i = 0; int n = sa->get_Count(); // Display the filepaths of the files created: while (i < n) { strOut.append(sa->getString(i)); strOut.append("\r\n"); i = i + 1; } delete sa; SetDlgItemText(IDC_EDIT1,strOut.getUnicode()); } |
© 2000-2022 Chilkat Software, Inc. All Rights Reserved.