Windows Forms App - COM -Komponentenfehler bei der Dateikreiber - WinPEC#

Ein Treffpunkt für C#-Programmierer
Guest
 Windows Forms App - COM -Komponentenfehler bei der Dateikreiber - WinPE

Post by Guest »

Ich habe App, die sowohl in Windows als auch in Winpe ausgeführt wird. In Windows läuft OK, in Winpe läuft auch OK, aber wenn ich die Datei speichere, gibt sie Fehler zurück. Wenn jemand dieses Problem hatte, helfen Sie mir bitte mit Informationen. Ich habe Dependenty Walker ausprobiert und DLLs bewegt, alle verfügbaren Pakete installiert, aber dennoch gleicher Fehler. net /cu5aufer.png " /> < /p>
Ein Fehler beim Generieren des Bericht -8dba-335ec946e8b8} Aus dem
iCLASSFACTORY fehlgeschlagen aufgrund des folgenden Fehlers: 80040111
classFactory kann die angeforderte Klasse nicht liefern (Ausnahme von
hResult: 0x80040111 (class_e_classnotavailable). < /P> < /p> < /p> < /p> < /p> < /p> < /p> < /> Dies ist der Teil, in dem die Dateispeicherung < /p>
passiert

Code: Select all

string fileName = string.Empty;

if (IsWinPE())
{
string exeDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
string reportsFolder = Path.Combine(exeDirectory, "Reports");

if (!Directory.Exists(reportsFolder))
{
Directory.CreateDirectory(reportsFolder);
}

fileName = Path.Combine("C:\\", "ErasureReport.pdf");
}
else
{
using (SaveFileDialog saveFileDialog = new SaveFileDialog())
{
saveFileDialog.Filter = "PDF Files (*.pdf)|*.pdf";
saveFileDialog.FileName = $"ErasureReport_{DateTime.Now:yyyyMMdd_HHmmss}.pdf";

if (saveFileDialog.ShowDialog() == DialogResult.OK)
{
fileName = saveFileDialog.FileName;
}
else
{
return;
}
}
}

DebugCheckpoint("About to save document to: " + fileName);
document.Save(fileName);
MessageBox.Show("Report saved successfully!\nPlease open the file manually.", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);

try
{
Process.Start(new ProcessStartInfo(fileName) { UseShellExecute = true });
}
catch (Exception ex)
{
MessageBox.Show("The report was saved but could not be opened automatically.\n" + ex.Message, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}

if (!IsWinPE())
{
try
{
Process.Start(new ProcessStartInfo(fileName) { UseShellExecute = true });
}
catch (Exception ex)
{
MessageBox.Show("Report saved successfully, but the file could not be opened automatically. Please open the file manually.\n\n" + ex.Message, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post