新しいクラスインスタンスを作成すると、「System.Deployment.dllでタイプ'System.Deployment.Application.InvalidDeploymentException'の最初のチャンスの例外が発生しました」というメッセージが表示されます。
それはで起こります:
PrinterSettings^ MyPS = gcnew PrinterSettings();
すべてが正常に機能し、必要な値が得られます。
Form1.cpp:
#include "stdafx.h"
#include "Form1.h"
#include "Print.h"
#include <iostream>
System::Void DPrint::Form1::Form1_Load(System::Object^ sender, System::EventArgs^ e)
{
PrinterSettings^ MyPS = gcnew PrinterSettings();
System::Windows::Forms::MessageBox::Show("From Class PrinterSettings: " + MyPS->IniFilePath());
}
Print.h:
#ifndef PRINT_H
#define PRINT_H
public ref class PrinterSettings
{
private:
System::String^ m_strPath;
public:
PrinterSettings()
{
m_strPath = System::Windows::Forms::Application::UserAppDataPath;
}
System::String^ IniFilePath() { return m_strPath; };
};
#endif
何が起こっているのかアイデアはありますか?ありがとうございました。