0x771009D6 (ntdll.dll) で例外がスローされました (GraphicDx.exe 内): 0xC0000005: 場所 0x1881206B の読み取り中にアクセス違反が発生しました
この例外のハンドラーがある場合は、プログラムを安全に続行できます。
と例外がでます。これをなくすにはどうすればよいのでしょうか?
Main関数の部分を、Dxライブラリの初期化処理のために改変しました。
とりあえず、エラーに関係していそうな部分を載せておきます。
例外が出る前のMyForm.cppです↓
#include "MyForm.h"
#include "DxLib.h"
using namespace System;
using namespace System::Windows::Forms;
[STAThread]
void Main(array<String^>^ args)
{
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
CppWinForm1::MyForm form;
Application::Run(%form);
}
#include "MyForm.h"
#include "DxLib.h"
using namespace System;
using namespace System::Windows::Forms;
[STAThread]
int Main()
{
if (DxLib_Init() == -1) { return -1; }
void ApiMain(array<String^>^ args);
{
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
CppWinForm1::MyForm form;
Application::Run(%form);
}
DxLib_End();
return 0;
}